babeld delete temporarly generate files
ensure temporarly generated config files doesn't linger accross babeld restarts
This commit is contained in:
parent
bde0c003a0
commit
aab56c9b80
1 changed files with 10 additions and 1 deletions
|
@ -8,6 +8,7 @@ START=70
|
||||||
CONFIGFILE='/var/etc/babeld.conf'
|
CONFIGFILE='/var/etc/babeld.conf'
|
||||||
OTHERCONFIGFILE="/etc/babeld.conf"
|
OTHERCONFIGFILE="/etc/babeld.conf"
|
||||||
OTHERCONFIGDIR="/tmp/babeld.d/"
|
OTHERCONFIGDIR="/tmp/babeld.d/"
|
||||||
|
TMPCONFIGDIR="/tmp/babeld_init_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."
|
||||||
|
|
||||||
|
@ -136,7 +137,7 @@ babel_config_cb() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
interfaceFile="${OTHERCONFIGDIR}/interface_$interface.conf"
|
interfaceFile="${TMPCONFIGDIR}/interface_$interface.conf"
|
||||||
|
|
||||||
if [ "$interface" == "default" ]; then
|
if [ "$interface" == "default" ]; then
|
||||||
echo "default" > "$interfaceFile"
|
echo "default" > "$interfaceFile"
|
||||||
|
@ -178,6 +179,8 @@ start_service() {
|
||||||
mkdir -p /var/lib
|
mkdir -p /var/lib
|
||||||
mkdir -p /var/etc
|
mkdir -p /var/etc
|
||||||
mkdir -p "$OTHERCONFIGDIR"
|
mkdir -p "$OTHERCONFIGDIR"
|
||||||
|
rm -rf "$TMPCONFIGDIR"
|
||||||
|
mkdir -p "$TMPCONFIGDIR"
|
||||||
|
|
||||||
# Start by emptying the generated config file
|
# Start by emptying the generated config file
|
||||||
>"$CONFIGFILE"
|
>"$CONFIGFILE"
|
||||||
|
@ -203,6 +206,12 @@ start_service() {
|
||||||
[ -f "$f" ] && cat "$f" >> "$CONFIGFILE"
|
[ -f "$f" ] && cat "$f" >> "$CONFIGFILE"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Import temporary config files
|
||||||
|
for f in "$TMPCONFIGDIR"/*.conf; do
|
||||||
|
[ -f "$f" ] && cat "$f" >> "$CONFIGFILE"
|
||||||
|
done
|
||||||
|
rm -rf "$TMPCONFIGDIR"
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
# Using multiple config files is supported since babeld 1.5.1
|
# Using multiple config files is supported since babeld 1.5.1
|
||||||
procd_set_param command /usr/sbin/babeld -I "" -c "$OTHERCONFIGFILE" -c "$CONFIGFILE"
|
procd_set_param command /usr/sbin/babeld -I "" -c "$OTHERCONFIGFILE" -c "$CONFIGFILE"
|
||||||
|
|
Loading…
Reference in a new issue