summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-03-04 18:37:03 +0100
committerFelix Fietkau <nbd@openwrt.org>2014-03-19 15:19:56 +0100
commit9cf7219d554f73c014b9c6efde7965384d8346ec (patch)
tree6e47c9cfa2813676a6cc72230e83036024eb2b2d /config.c
parent047a1ee7680e9a668896a12e2773d6544669d0e9 (diff)
downloadnetifd-9cf7219d554f73c014b9c6efde7965384d8346ec.tar.gz
uci: Allow setting the UCI config path on the command line
Add a -c switch which allows setting an alternative UCI path instead of using the libuci default. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Diffstat (limited to 'config.c')
-rw-r--r--config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/config.c b/config.c
index 6784dda..4fe72dc 100644
--- a/config.c
+++ b/config.c
@@ -190,8 +190,10 @@ config_init_package(const char *config)
ctx = uci_alloc_context();
uci_ctx = ctx;
+ if (config_path)
+ uci_set_confdir(ctx, config_path);
+
#ifdef DUMMY_MODE
- uci_set_confdir(ctx, "./config");
uci_set_savedir(ctx, "./tmp");
#endif
} else {