diff --git a/exec/localcopy.js b/exec/localcopy.js index 913dbe42165db9b433164ff1d6efaf480f533c66..e5051e4760efabf19fba1527d5bd423181bba9e6 100644 --- a/exec/localcopy.js +++ b/exec/localcopy.js @@ -1,10 +1,8 @@ -// $Id: localcopy.js,v 1.3 2020/05/14 01:25:32 rswindell Exp $ - // A simple script that just copies a file on the local/server side // Install using 'jsexec localcopy.js install' -// Or manually in SCFG->File Options->File Transfer Protcools: +// Or manually in SCFG->File Options->File Transfer Protocols: // Mnemonic (Command Key) L // Protocol Name Local // Access Requirements SYSOP @@ -13,9 +11,11 @@ // Batch Upload Command Line ?localcopy send %g // Batch Download Command Line ?localcopy recv %s // Bi-dir Command Line -// Native (32-bit) Executable No -// Supports DSZLOG No -// Socket I/O No +// Native Executable/Script Yes +// Supports DSZLOG No +// Socket I/O No + +require("sbbsdefs.js", "PROT_NATIVE"); // Copy a file, confirm over-write, preserving original date/time stamp function fcopy(src, dest) @@ -41,11 +41,12 @@ function main(cmd) { switch(cmd) { case 'install': + case '-install': var cnflib = load({}, "cnflib.js"); var file_cnf = cnflib.read("file.cnf"); if(!file_cnf) { alert("Failed to read file.cnf"); - return(-1); + exit(-1); } file_cnf.prot.push({ key: 'L' @@ -55,13 +56,14 @@ function main(cmd) { , batulcmd: '?localcopy send %g' , batdlcmd: '?localcopy recv %s' , ars: 'SYSOP' + , settings: PROT_NATIVE }); if(!cnflib.write("file.cnf", undefined, file_cnf)) { alert("Failed to write file.cnf"); - return(-1); + exit(-1); } - return(0); + exit(0); case 'send': if(file_isdir(argv[1])) { /* batch upload */