diff options
| author | arf20 <aruizfernandez05@gmail.com> | 2025-11-10 23:50:02 +0100 |
|---|---|---|
| committer | arf20 <aruizfernandez05@gmail.com> | 2025-11-10 23:50:02 +0100 |
| commit | 6bf70db630afa19d0407d6468df8de307bccfecd (patch) | |
| tree | 6f33f87121d6b00424fb3bec4230e8ac9feefc8c /main.c | |
| parent | 26aedc1555186b3be00cf719c2376585035b86af (diff) | |
| download | arfnet2-status-6bf70db630afa19d0407d6468df8de307bccfecd.tar.gz arfnet2-status-6bf70db630afa19d0407d6468df8de307bccfecd.zip | |
fix config
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -17,9 +17,6 @@ #include "check.h" #include "alert.h" -#define CFG_FILE "monitor.cfg" -#define TMPL_FILE "index.htm.tmpl" -#define LOG_FILE "events.log" static char *index_format_template = NULL; @@ -76,8 +73,11 @@ enum MHD_Result answer_to_connection( int main() { printf("ARFNET Status Monitor (C) 2025 under GPLv3\n"); + if (config_load(CONFIG_PATH) < 0) + return 1; + /* read index template file */ - FILE *tf = fopen(TMPL_FILE, "r"); + FILE *tf = fopen(tmpl_path, "r"); if (!tf) { fprintf(stderr, "error opening index template file: %s\n", strerror(errno)); @@ -90,9 +90,6 @@ int main() { fread(index_format_template, 1, tfs, tf); fclose(tf); - if (config_load(CONFIG_PATH) < 0) - return 1; - if (check_init() < 0) return 1; @@ -115,10 +112,9 @@ int main() { return 1; } - while (1) { check_perform(targets, targets_size); - monitor_update_events(LOG_FILE); + monitor_update_events(log_path); sleep(monitor_config.interval); } } |
