From 67fd69854489a088bc8d90702ba37cecccd6f169 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 16 Jun 2019 21:16:29 +0100 Subject: Load all settings from configuration file at startup instead of reading it for certain settings (password/nick/nick2/nick3). --- blabouncer.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'blabouncer.c') diff --git a/blabouncer.c b/blabouncer.c index 22252d7..c9a91aa 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -875,7 +875,13 @@ int main(int argc, char *argv[]) { exit(1); } - // What port should the bouncer listen on + // What is the bouncer password? + if (!getconfstr("password", settings.conffile, settings.password)) { + printf("main(): error getting 'password' from configuration file.\n"); + exit(1); + } + + // What port should the bouncer listen on? if (!getconfstr("clientport", settings.conffile, settings.clientport)) { printf("main(): error getting 'clientport' from configuration file.\n"); exit(1); @@ -887,6 +893,18 @@ int main(int argc, char *argv[]) { exit(1); } + // What is the configured nick2? + if (!getconfstr("nick2", settings.conffile, settings.ircnick2)) { + // Not configured, set to blank string + settings.ircnick2[0] = '\0'; + } + + // What is the configured nick3? + if (!getconfstr("nick3", settings.conffile, settings.ircnick3)) { + // Not configured, set to blank string + settings.ircnick3[0] = '\0'; + } + // What is the configured username? if (!getconfstr("username", settings.conffile, settings.ircusername)) { printf("main(): error getting 'username' from configuration file.\n"); -- cgit v1.2.3