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
No related branches found
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 $
/*
* 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:
* inbound non-secure default inbound directory path
......@@ -20,7 +20,7 @@
*/
var fidoaddr = load({}, 'fidoaddr.js');
function SBBSEchoCfg ()
function SBBSEchoCfg (fname)
{
var line;
var m;
......@@ -38,7 +38,7 @@ function SBBSEchoCfg ()
this.outbound = 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"))
throw new Error(ecfg.error + " opening '"+ecfg.name+"'");
......@@ -154,11 +154,11 @@ SBBSEchoCfg.prototype.match_pw = function(node, pw)
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 ecfg = new SBBSEchoCfg();
var ecfg = new SBBSEchoCfg(fname);
var domains;
if (f.open("r")) {
......
......@@ -32,10 +32,10 @@ require('fido.js', 'FIDO');
* num_to_basefn(num) converts an integer to a base-X string
* save() save the configuration
*/
function TickITCfg() {
function TickITCfg(fname) {
this.gcfg = undefined;
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 i;
var tmp;
......@@ -175,7 +175,7 @@ TickITCfg.prototype.get_next_tic_filename = function()
};
TickITCfg.prototype.save = function()
{
var tcfg = new File(system.ctrl_dir+'tickit.ini');
var tcfg = new File(this.cfgfile);
var sects;
var i;
var j;
......@@ -262,9 +262,9 @@ TickITCfg.prototype.save = function()
* FREQITCfg methods
* 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 i;
var key;
......@@ -314,9 +314,9 @@ function FREQITCfg()
}
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 i;
var j;
......@@ -363,9 +363,9 @@ FREQITCfg.prototype.save = function()
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;
this.node = {};
......
......@@ -27,8 +27,17 @@ load("sbbsdefs.js");
require("fidocfg.js", 'TickITCfg');
require("fido.js", 'FIDO');
var sbbsecho = new SBBSEchoCfg();
var tickit = new TickITCfg();
var cfgfile;
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 force_replace = false;
......@@ -731,10 +740,6 @@ function main() {
var ticfiles;
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
//
// current selection order:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment