From 80894502535d0930b1baca367e488b3234765901 Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Sat, 23 Jan 2021 14:24:18 -0800 Subject: [PATCH] Address installation issues (e.g. set the "native" settings flag) --- exec/localcopy.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/exec/localcopy.js b/exec/localcopy.js index 913dbe4216..e5051e4760 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 */ -- GitLab