summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-06-16 21:16:29 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-06-16 21:16:29 +0100
commit67fd69854489a088bc8d90702ba37cecccd6f169 (patch)
treeac0efe967e433d725cab51b6fe93aa685c928950 /blabouncer.c
parenta31e7b13b3cef0872be5922a568633d74dd408d2 (diff)
Load all settings from configuration file at startup instead of reading it for certain settings (password/nick/nick2/nick3).
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c20
1 files changed, 19 insertions, 1 deletions
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");