babeld: add support for dynamic config files
Signed-off-by: Steven Barth <steven@midlink.org> Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
This commit is contained in:
parent
6b8165cc1c
commit
82d9002689
1 changed files with 7 additions and 0 deletions
|
@ -7,6 +7,7 @@ START=70
|
||||||
pidfile='/var/run/babeld.pid'
|
pidfile='/var/run/babeld.pid'
|
||||||
CONFIGFILE='/var/etc/babeld.conf'
|
CONFIGFILE='/var/etc/babeld.conf'
|
||||||
OTHERCONFIGFILE="/etc/babeld.conf"
|
OTHERCONFIGFILE="/etc/babeld.conf"
|
||||||
|
OTHERCONFIGDIR="/tmp/babeld.d/"
|
||||||
EXTRA_COMMANDS="status"
|
EXTRA_COMMANDS="status"
|
||||||
EXTRA_HELP=" status Dump Babel's table to the log file."
|
EXTRA_HELP=" status Dump Babel's table to the log file."
|
||||||
|
|
||||||
|
@ -204,8 +205,14 @@ babel_config_cb() {
|
||||||
start() {
|
start() {
|
||||||
mkdir -p /var/lib
|
mkdir -p /var/lib
|
||||||
mkdir -p /var/etc
|
mkdir -p /var/etc
|
||||||
|
mkdir -p $OTHERCONFIGDIR
|
||||||
|
|
||||||
# Start by emptying the generated config file
|
# Start by emptying the generated config file
|
||||||
>"$CONFIGFILE"
|
>"$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
|
# First load the whole config file, without callbacks, so that we are
|
||||||
# aware of all "ignore" options in the second pass.
|
# aware of all "ignore" options in the second pass.
|
||||||
config_load babeld
|
config_load babeld
|
||||||
|
|
Loading…
Reference in a new issue