From 8164fa121e6982c114737d20938d48838a009c37 Mon Sep 17 00:00:00 2001 From: Jacob Date: Sun, 12 Jan 2020 17:32:36 -0500 Subject: [PATCH] Read config file if we use config option --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index d518efd..0d14b51 100644 --- a/main.c +++ b/main.c @@ -123,6 +123,7 @@ int read_config_file() { buf[strlen(buf) - 1] = 0; // We should add a method that overwrites the linked list node at an index. + fprintf(stderr, "Read %s from config file\n", buf); linkedlist_add(&hosts, buf); } } @@ -204,6 +205,7 @@ int main(int argc, char **argv) } else if (strcmp(argv[i], "-config") == 0) { CONFIG = argv[++i]; + read_config_file(); } // Daemonize this process, allowing for hosts file to be automagically managed.