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

Allow an alternate "services.ini" filename to be specified in sbbs.ini

Set sbbs.ini [services] iniFileName to something other than services.ini to override the default filename. The automatic/optional hostname decoration of the filename is still supported.

Addresses request #238.
parent 32f2df02
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1938 passed
......@@ -60,6 +60,7 @@ static const char* strJavaScriptYieldInterval ="JavaScriptYieldInterval";
static const char* strJavaScriptLoadPath ="JavaScriptLoadPath";
static const char* strJavaScriptOptions ="JavaScriptOptions";
static const char* strSemFileCheckFrequency ="SemFileCheckFrequency";
static const char* strIniFileName ="iniFileName";
#define DEFAULT_LOG_LEVEL LOG_DEBUG
#define DEFAULT_BIND_RETRY_COUNT 2
......@@ -603,6 +604,9 @@ void sbbs_read_ini(
SAFECOPY(services->temp_dir
,iniGetString(list,section,strTempDirectory,global->temp_dir,value));
SAFECOPY(services->services_ini
,iniGetString(list, section, strIniFileName, "servicse.ini", value));
SAFECOPY(services->answer_sound
,iniGetString(list,section,strAnswerSound,nulstr,value));
SAFECOPY(services->hangup_sound
......@@ -1141,6 +1145,9 @@ BOOL sbbs_write_ini(
if(!iniSetString(lp,section,strHangupSound,services->hangup_sound,&style))
break;
if(!iniSetString(lp, section, strIniFileName, services->services_ini, &style))
break;
if(!iniSetBitField(lp,section,strOptions,service_options,services->options,&style))
break;
......
......@@ -1907,7 +1907,7 @@ void services_thread(void* arg)
if(uptime==0)
uptime=time(NULL); /* this must be done *after* setting the timezone */
iniFileName(services_ini,sizeof(services_ini),scfg.ctrl_dir,"services.ini");
iniFileName(services_ini,sizeof(services_ini),scfg.ctrl_dir, startup->services_ini);
if((service=read_services_ini(services_ini, service, &services))==NULL) {
cleanup(1);
......
/* Synchronet main/telnet server thread startup structure */
/* $Id: services.h,v 1.45 2019/03/22 21:28:27 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -15,21 +11,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -68,7 +52,8 @@ typedef struct {
char temp_dir[128];
char answer_sound[128];
char hangup_sound[128];
char ini_fname[128];
char ini_fname[128]; // sbbs.ini path/filename
char services_ini[128]; // services.ini filename
/* Misc */
char host_name[128];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment