aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 40b5f71..e070911 100644
--- a/src/main.c
+++ b/src/main.c
@@ -323,9 +323,17 @@ int main(int argc, char *argv[]) {
ctx.meta.python_compact = to_short_version(ctx.meta.python);
}
+ if (!config_input) {
+ // no configuration passed by argument. use basic config.
+ char cfgfile[PATH_MAX * 2];
+ sprintf(cfgfile, "%s/%s", globals.sysconfdir, "omc.ini");
+ if (!access(cfgfile, F_OK)) {
+ config_input = strdup(cfgfile);
+ }
+ }
+
if (config_input) {
msg(OMC_MSG_L2, "Reading OMC global configuration: %s\n", config_input);
-
ctx._omc_ini_fp.cfg = ini_open(config_input);
if (!ctx._omc_ini_fp.cfg) {
msg(OMC_MSG_ERROR | OMC_MSG_L2, "Failed to read config file: %s, %s\n", delivery_input, strerror(errno));