diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-06-26 19:59:27 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-06-26 20:08:28 +0200 |
commit | 96090fdec1db6e350bc9e0db0c632f495b33f595 (patch) | |
tree | afda3eb7188ecdc4297e7b3d0e13f70288a63d35 | |
parent | 866b6c5e3766f65719f730ac4dac11b221a6692a (diff) |
#988 use ogserver.json fallback to legacy configuration file
Check for ogserver.json file first, then fall back to legacy.
-rw-r--r-- | sources/main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sources/main.c b/sources/main.c index 3588e4c..5f6d164 100644 --- a/sources/main.c +++ b/sources/main.c @@ -18,7 +18,7 @@ #include "cfg.h" #include <syslog.h> -#define OG_SERVER_CFG_DATABASE "/opt/opengnsys/cfg/ogserver.json" +#define OG_SERVER_CFG_JSON "/opt/opengnsys/cfg/ogserver.json" int main(int argc, char *argv[]) { @@ -36,11 +36,12 @@ int main(int argc, char *argv[]) if (!validacionParametros(argc, argv, 1)) // Valida parámetros de ejecución exit(EXIT_FAILURE); - if (!tomaConfiguracion(szPathFileCfg)) { - syslog(LOG_INFO, "falling back to %s\n", OG_SERVER_CFG_DATABASE); - if (parse_json_config(OG_SERVER_CFG_DATABASE, &cfg) < 0) + if (parse_json_config(OG_SERVER_CFG_JSON, &cfg) < 0) { + syslog(LOG_INFO, "Falling back to legacy configuration file at %s\n", + szPathFileCfg); + if (!tomaConfiguracion(szPathFileCfg)) exit(EXIT_FAILURE); - + } else { from_json_to_legacy(&cfg); } |