diff options
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -61,6 +61,7 @@ conf_t *conf_load( int argc, char *argv[] ) conf->oper_pass = NULL; conf->configdir = g_strdup( CONFIG ); conf->plugindir = g_strdup( PLUGINDIR ); + conf->pidfile = g_strdup( "/var/run/bitlbee.pid" ); conf->motdfile = g_strdup( ETCDIR "/motd.txt" ); conf->ping_interval = 180; conf->ping_timeout = 300; @@ -77,7 +78,7 @@ conf_t *conf_load( int argc, char *argv[] ) fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", CONF_FILE ); } - while( argc > 0 && ( opt = getopt( argc, argv, "i:p:nvIDFc:d:hR:" ) ) >= 0 ) + while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:hR:" ) ) >= 0 ) /* ^^^^ Just to make sure we skip this step from the REHASH handler. */ { if( opt == 'i' ) @@ -93,6 +94,11 @@ conf_t *conf_load( int argc, char *argv[] ) } conf->port = i; } + else if( opt == 'p' ) + { + g_free( conf->pidfile ); + conf->pidfile = g_strdup( optarg ); + } else if( opt == 'n' ) conf->nofork = 1; else if( opt == 'v' ) @@ -184,6 +190,11 @@ static int conf_loadini( conf_t *conf, char *file ) else conf->runmode = RUNMODE_INETD; } + else if( g_strcasecmp( ini->key, "pidfile" ) == 0 ) + { + g_free( conf->pidfile ); + conf->pidfile = g_strdup( ini->value ); + } else if( g_strcasecmp( ini->key, "daemoninterface" ) == 0 ) { conf->iface = g_strdup( ini->value ); |