From 82d9002689937d9257b6d2536ca59d7b9b01c980 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 21 May 2015 08:22:37 +0200 Subject: [PATCH] babeld: add support for dynamic config files Signed-off-by: Steven Barth Signed-off-by: Markus Stenberg --- babeld/files/babeld.init | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/babeld/files/babeld.init b/babeld/files/babeld.init index 585fc76..797ba2f 100755 --- a/babeld/files/babeld.init +++ b/babeld/files/babeld.init @@ -7,6 +7,7 @@ START=70 pidfile='/var/run/babeld.pid' CONFIGFILE='/var/etc/babeld.conf' OTHERCONFIGFILE="/etc/babeld.conf" +OTHERCONFIGDIR="/tmp/babeld.d/" EXTRA_COMMANDS="status" EXTRA_HELP=" status Dump Babel's table to the log file." @@ -204,8 +205,14 @@ babel_config_cb() { start() { mkdir -p /var/lib mkdir -p /var/etc + mkdir -p $OTHERCONFIGDIR + # Start by emptying the generated config file >"$CONFIGFILE" + # Import dynamic config files + for f in $OTHERCONFIGDIR/*.conf; do + [ -f "$f" ] && cat $f >> $CONFIGFILE + done # First load the whole config file, without callbacks, so that we are # aware of all "ignore" options in the second pass. config_load babeld -- 2.35.1