Use default config file when none is provided

Add config option to set a default config file path. If
none given, the default config file path is /etc/clixon.xml.
This commit is contained in:
Matthew Smith 2018-01-14 21:25:17 -06:00
parent 363bd5d19d
commit 6a9697c2ff
4 changed files with 32 additions and 2 deletions

View file

@ -202,8 +202,7 @@ clicon_options_main(clicon_handle h)
* Set configure file if not set by command-line above
*/
if (!hash_lookup(copt, "CLICON_CONFIGFILE")){
clicon_err(OE_CFG, 0, "CLICON_CONFIGFILE (-f) not set");
goto done;
clicon_option_str_set(h, "CLICON_CONFIGFILE", CLIXON_DEFAULT_CONFIG);
}
configfile = hash_value(copt, "CLICON_CONFIGFILE", NULL);
clicon_debug(1, "CLICON_CONFIGFILE=%s", configfile);