diff options
Diffstat (limited to 'conf.c')
| -rw-r--r-- | conf.c | 13 | 
1 files changed, 12 insertions, 1 deletions
@@ -60,6 +60,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; @@ -76,7 +77,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:h" ) ) >= 0 ) +	while( argc > 0 && ( opt = getopt( argc, argv, "i:p:P:nvIDFc:d:h" ) ) >= 0 )  	/*     ^^^^ Just to make sure we skip this step from the REHASH handler. */  	{  		if( opt == 'i' ) @@ -92,6 +93,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' ) @@ -175,6 +181,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 );  | 
