forked from freifunk-franken/firmware
fff-fastd: fix fastd start/stop
fastd startup changed to procd. That's why it's broken. Now a fastd reload can be used for all conditions. An extra fastd stop is implemented to bring down the Interface. fastd reload doesn't do that. Fixes: #215 Signed-off-by: Robert Langhammer <rlanghammer@web.de> Acked-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
parent
8e127a3936
commit
7a5bef0d7d
|
@ -1,7 +1,7 @@
|
|||
protocol=fastd
|
||||
|
||||
fastd_clear() {
|
||||
rm /tmp/fastd_fff_peers/*
|
||||
rm /tmp/fastd_fff_peers/* 2>/dev/null
|
||||
}
|
||||
|
||||
fastd_addpeer() {
|
||||
|
@ -21,14 +21,9 @@ fastd_addpeer() {
|
|||
}
|
||||
|
||||
fastd_start_stop() {
|
||||
/etc/init.d/fastd reload # does nothing if fastd was not running
|
||||
|
||||
# fastd start/stop for various situations
|
||||
# this is needed for first start and if fastd comes up or disappears in hoodfile
|
||||
pidfile="/tmp/run/fastd.fff.pid"
|
||||
if [ "$(ls /etc/fastd/fff/peers/* 2>/dev/null)" ]; then
|
||||
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) || /etc/init.d/fastd start
|
||||
if ls /etc/fastd/fff/peers/* &>/dev/null; then
|
||||
/etc/init.d/fastd reload
|
||||
else
|
||||
([ -s "$pidfile" ] && [ -d "/proc/$(cat "$pidfile")" ]) && /etc/init.d/fastd stop
|
||||
/etc/init.d/fastd stop
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user