Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
06fda013
Commit
06fda013
authored
3 years ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Patch by @acn to include a non-interactive mode, fix point paths, and tic pw
parent
635c258d
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/hatchit.js
+106
-4
106 additions, 4 deletions
exec/hatchit.js
with
106 additions
and
4 deletions
exec/hatchit.js
+
106
−
4
View file @
06fda013
#!/usr/bin/env -S jsexec -n
load
(
"
sbbsdefs.js
"
);
load
(
"
uifcdefs.js
"
);
load
(
"
fidocfg.js
"
);
...
...
@@ -209,7 +211,8 @@ function hatch_file(file, area, origin, replaces)
return
false
;
}
pw
=
sbbsecho
.
get_pw
(
link
);
pw
=
sbbsecho
.
get_ticpw
(
FIDO
.
parse_addr
(
link
).
toString
());
if
(
pw
===
undefined
)
pw
=
''
;
...
...
@@ -226,6 +229,13 @@ function hatch_file(file, area, origin, replaces)
outb
=
sbbsecho
.
outbound
.
replace
(
/
[\\\/]
+$/g
,
''
);
if
(
addr
.
zone
!==
defzone
)
outb
+=
format
(
"
.%03x
"
,
addr
.
zone
);
if
(
addr
.
point
!==
undefined
)
{
outb
+=
format
(
"
/%04x
"
,
addr
.
net
);
outb
+=
format
(
"
%04x
"
,
addr
.
node
);
outb
+=
"
.pnt
"
}
outb
=
fullpath
(
outb
);
outb
=
backslash
(
outb
);
...
...
@@ -237,7 +247,7 @@ function hatch_file(file, area, origin, replaces)
}
tf
.
write
(
'
Area
'
+
area
+
'
\r\n
'
);
tf
.
write
(
'
Origin
'
+
origin
+
'
\r\n
'
);
tf
.
write
(
'
From
'
+
system
.
fido_addr_list
[
0
]
+
'
\r\n
'
);
tf
.
write
(
'
From
'
+
origin
+
'
\r\n
'
);
tf
.
write
(
'
To
'
+
link
+
'
\r\n
'
);
tf
.
write
(
'
File
'
+
file
.
name
+
'
\r\n
'
);
if
(
file_getcase
(
file
.
path
).
length
>
file
.
path
.
length
)
{
...
...
@@ -268,7 +278,11 @@ function hatch_file(file, area, origin, replaces)
tf
.
close
();
// Create bsy file...
flobase
=
outb
+
format
(
"
%04x%04x
"
,
addr
.
net
,
addr
.
node
);
if
(
addr
.
point
!==
undefined
)
{
flobase
=
outb
+
format
(
"
0000%04x
"
,
addr
.
point
);
}
else
{
flobase
=
outb
+
format
(
"
%04x%04x
"
,
addr
.
net
,
addr
.
node
);
}
bf
=
new
File
(
flobase
+
'
.bsy
'
);
while
(
!
bf
.
open
(
'
wxb+
'
))
{
// TODO: This waits forever...
...
...
@@ -294,7 +308,7 @@ function hatch_file(file, area, origin, replaces)
return
true
;
}
function
ma
in
()
{
function
in
teractive
()
{
var
file
;
var
area
;
var
origin
;
...
...
@@ -329,4 +343,92 @@ function main() {
}
}
function
main
()
{
var
dir
;
var
file
;
var
area
;
var
origin
;
var
replace
;
for
(
var
i
=
0
;
i
<
argc
;
i
++
)
{
var
arg
=
argv
[
i
];
if
(
arg
[
0
]
==
'
-
'
)
{
var
opt
=
arg
;
while
(
opt
[
0
]
==
'
-
'
)
opt
=
opt
.
slice
(
1
);
if
(
opt
==
"
help
"
||
opt
==
"
?
"
||
opt
==
"
h
"
)
{
writeln
(
"
usage: hatchit.js [option]
"
);
writeln
(
"
options:
"
);
writeln
(
"
-dir=<filedir> File directory Internal Code
"
);
writeln
(
"
-file=<filename> Name of file to hatch
"
);
writeln
(
"
-area=<areatag> File area of file to hatch
"
);
writeln
(
"
-origin=<FTN AKA> Origin FTN AKA
"
);
writeln
(
"
-replace File replaces older version
"
);
writeln
(
""
);
writeln
(
"
If no option is given, HatchIT will start in interactive mode.
"
);
exit
(
0
);
}
if
(
opt
.
indexOf
(
"
dir=
"
)
==
0
)
{
var
indir
=
opt
.
slice
(
4
);
dir
=
file_area
.
dir
[
indir
.
toLowerCase
()];
if
(
!
dir
)
{
alert
(
"
File directory not found:
"
+
indir
);
exit
(
1
);
}
continue
;
}
if
(
opt
.
indexOf
(
"
area=
"
)
==
0
)
{
var
inarea
=
opt
.
slice
(
5
);
area
=
inarea
.
toUpperCase
();
if
(
!
tickit
.
acfg
[
inarea
.
toLowerCase
()])
{
alert
(
"
File area not found:
"
+
area
);
exit
(
1
);
}
continue
;
}
if
(
opt
.
indexOf
(
"
file=
"
)
==
0
)
{
infile
=
opt
.
slice
(
5
);
var
fb
=
new
OldFileBase
(
dir
.
code
.
toLowerCase
());
fb
.
forEach
(
function
(
f
)
{
if
(
f
.
name
==
infile
)
{
file
=
f
;
}
});
if
(
!
file
)
{
alert
(
"
Cannot open file:
"
+
infile
);
exit
(
1
);
}
continue
;
}
if
(
opt
.
indexOf
(
"
origin=
"
)
==
0
)
{
origin
=
opt
.
slice
(
7
);
if
(
system
.
fido_addr_list
.
indexOf
(
origin
)
==
-
1
)
{
alert
(
"
Origin is not in list of AKAs:
"
+
origin
);
exit
(
1
);
}
continue
;
}
if
(
opt
.
indexOf
(
"
replace
"
)
==
0
)
{
replace
=
true
;
}
else
{
replace
=
false
;
}
continue
;
}
}
if
(
dir
==
undefined
&&
area
==
undefined
&&
file
==
undefined
&&
origin
==
undefined
&&
replace
==
undefined
)
interactive
()
writeln
(
"
File :
"
+
file
.
name
);
writeln
(
"
Area :
"
+
area
);
writeln
(
"
Origin :
"
+
origin
);
writeln
(
"
Desc :
"
+
file
.
desc
);
if
(
replace
)
writeln
(
"
Replace: yes
"
);
else
writeln
(
"
Replace: no
"
);
if
(
file
.
extdesc
)
writeln
(
"
LDesc :
"
+
file
.
extdesc
);
hatch_file
(
file
,
area
,
origin
,
replace
);
}
main
();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment