Skip to content
Snippets Groups Projects
Commit 899b58e0 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow custom tickit config (ini) filename to be passed on command-line.

Similarly, if the tickit config file has an 'echocfg' key, that can point
to a custom SBBSecho config (ini) filename.

These filenames are just the name-portion, the path is still assumed to
be the ctrl directory.

For Dream Master.
parent d33e6a44
Branches
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
// $Id: fido_syscfg.js,v 1.24 2020/05/16 20:10:19 rswindell Exp $ // $Id: fido_syscfg.js,v 1.24 2020/05/16 20:10:19 rswindell Exp $
/* /*
* Parse as much as needed from the SBBSecho configuration. * Parse as much as needed from the SBBSecho configuration.
* v3+ uses sbbsecho.ini. * v3+ uses sbbsecho.ini by default, other filenames are supported.
* *
* SBBSEchoCfg Properties: * SBBSEchoCfg Properties:
* inbound non-secure default inbound directory path * inbound non-secure default inbound directory path
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
*/ */
var fidoaddr = load({}, 'fidoaddr.js'); var fidoaddr = load({}, 'fidoaddr.js');
function SBBSEchoCfg () function SBBSEchoCfg (fname)
{ {
var line; var line;
var m; var m;
...@@ -38,7 +38,7 @@ function SBBSEchoCfg () ...@@ -38,7 +38,7 @@ function SBBSEchoCfg ()
this.outbound = undefined; this.outbound = undefined;
var packer = undefined; var packer = undefined;
ecfg = new File(file_cfgname(system.ctrl_dir, 'sbbsecho.ini')); ecfg = new File(file_cfgname(system.ctrl_dir, fname || 'sbbsecho.ini'));
if (!ecfg.open("r")) if (!ecfg.open("r"))
throw new Error(ecfg.error + " opening '"+ecfg.name+"'"); throw new Error(ecfg.error + " opening '"+ecfg.name+"'");
...@@ -154,11 +154,11 @@ SBBSEchoCfg.prototype.match_pw = function(node, pw) ...@@ -154,11 +154,11 @@ SBBSEchoCfg.prototype.match_pw = function(node, pw)
return false; return false;
}; };
function FTNDomains() function FTNDomains(fname)
{ {
var f = new File(file_cfgname(system.ctrl_dir, 'sbbsecho.ini')); var f = new File(file_cfgname(system.ctrl_dir, fname || 'sbbsecho.ini'));
var used_zones = {}; var used_zones = {};
var ecfg = new SBBSEchoCfg(); var ecfg = new SBBSEchoCfg(fname);
var domains; var domains;
if (f.open("r")) { if (f.open("r")) {
......
...@@ -32,10 +32,10 @@ require('fido.js', 'FIDO'); ...@@ -32,10 +32,10 @@ require('fido.js', 'FIDO');
* num_to_basefn(num) converts an integer to a base-X string * num_to_basefn(num) converts an integer to a base-X string
* save() save the configuration * save() save the configuration
*/ */
function TickITCfg() { function TickITCfg(fname) {
this.gcfg = undefined; this.gcfg = undefined;
this.acfg = {}; this.acfg = {};
var tcfg = new File(system.ctrl_dir+'tickit.ini'); var tcfg = new File(file_cfgname(system.ctrl_dir, fname || 'tickit.ini'));
var sects; var sects;
var i; var i;
var tmp; var tmp;
...@@ -175,7 +175,7 @@ TickITCfg.prototype.get_next_tic_filename = function() ...@@ -175,7 +175,7 @@ TickITCfg.prototype.get_next_tic_filename = function()
}; };
TickITCfg.prototype.save = function() TickITCfg.prototype.save = function()
{ {
var tcfg = new File(system.ctrl_dir+'tickit.ini'); var tcfg = new File(this.cfgfile);
var sects; var sects;
var i; var i;
var j; var j;
...@@ -262,9 +262,9 @@ TickITCfg.prototype.save = function() ...@@ -262,9 +262,9 @@ TickITCfg.prototype.save = function()
* FREQITCfg methods * FREQITCfg methods
* save() Saves the freqit config to the INI file * save() Saves the freqit config to the INI file
*/ */
function FREQITCfg() function FREQITCfg(fname)
{ {
var f=new File(system.ctrl_dir+'freqit.ini'); var f=new File(file_cfgname(system.ctrl_dir, fname || 'freqit.ini'));
var val; var val;
var i; var i;
var key; var key;
...@@ -314,9 +314,9 @@ function FREQITCfg() ...@@ -314,9 +314,9 @@ function FREQITCfg()
} }
f.close(); f.close();
} }
FREQITCfg.prototype.save = function() FREQITCfg.prototype.save = function(fname)
{ {
var fcfg = new File(system.ctrl_dir+'freqit.ini'); var fcfg = new File(file_cfgname(system.ctrl_dir, fname || 'freqit.ini'));
var sects; var sects;
var i; var i;
var j; var j;
...@@ -363,9 +363,9 @@ FREQITCfg.prototype.save = function() ...@@ -363,9 +363,9 @@ FREQITCfg.prototype.save = function()
return true; return true;
}; };
function BinkITCfg() function BinkITCfg(fname)
{ {
var f=new File(file_cfgname(system.ctrl_dir, 'sbbsecho.ini')); var f=new File(file_cfgname(system.ctrl_dir, fname || 'sbbsecho.ini'));
var sects; var sects;
this.node = {}; this.node = {};
......
...@@ -27,8 +27,17 @@ load("sbbsdefs.js"); ...@@ -27,8 +27,17 @@ load("sbbsdefs.js");
require("fidocfg.js", 'TickITCfg'); require("fidocfg.js", 'TickITCfg');
require("fido.js", 'FIDO'); require("fido.js", 'FIDO');
var sbbsecho = new SBBSEchoCfg(); var cfgfile;
var tickit = new TickITCfg();
for (var i in argv) {
if(argv[i] == "-force-replace")
force_replace = true;
else if(argv[i][0] != '-')
cfgfile = argv[i];
}
var tickit = new TickITCfg(cfgfile);
var sbbsecho = new SBBSEchoCfg(tickit.gcfg.echocfg);
var files_bbs={}; var files_bbs={};
var force_replace = false; var force_replace = false;
...@@ -731,10 +740,6 @@ function main() { ...@@ -731,10 +740,6 @@ function main() {
var ticfiles; var ticfiles;
var tic; var tic;
for (i in argv)
if(argv[i] == "-force-replace")
force_replace = true;
// check source FTN address overrides and list for debugging purposes - wk42 // check source FTN address overrides and list for debugging purposes - wk42
// //
// current selection order: // current selection order:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment