2008-05-29 20:58:34 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
|
|
|
|
START=70
|
|
|
|
|
2009-08-23 11:26:33 +00:00
|
|
|
pidfile=/var/run/babeld.pid
|
2008-05-29 20:58:34 +00:00
|
|
|
|
2009-11-22 04:02:17 +00:00
|
|
|
babeld_config() {
|
|
|
|
local cfg="$1"
|
|
|
|
config_get interfaces "$cfg" interfaces
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
config_load babeld
|
|
|
|
config_foreach babeld_config babeld
|
|
|
|
mkdir -p /var/lib
|
|
|
|
if [ -e $pidfile ] ; then
|
|
|
|
echo "$pidfile exists -- not starting babel." >&2
|
|
|
|
else
|
|
|
|
/usr/sbin/babeld -D -I $pidfile $interfaces
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
[ -e $pidfile ] && kill $(cat $pidfile)
|
|
|
|
[ -e $pidfile ] && sleep 2
|
|
|
|
[ -e $pidfile ] && sleep 4
|
|
|
|
[ -e $pidfile ] && echo "Failed to stop babel ($pidfile still exists)."
|
|
|
|
}
|
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
|
|
|
|
START=70
|
|
|
|
|
|
|
|
pidfile=/var/run/babeld.pid
|
|
|
|
|
2008-05-29 20:58:34 +00:00
|
|
|
babel_config() {
|
|
|
|
local cfg="$1"
|
|
|
|
config_get interfaces "$cfg" interfaces
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
2009-04-19 20:32:11 +00:00
|
|
|
if [ -x /etc/rc.d/S71ahcpd ] ; then
|
2008-05-29 20:58:34 +00:00
|
|
|
echo 'Not starting babel -- will be started by ahcpd.'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
config_load babel
|
|
|
|
config_foreach babel_config babel
|
|
|
|
mkdir -p /var/lib
|
|
|
|
if [ -e $pidfile ] ; then
|
|
|
|
echo "$pidfile exists -- not starting babel." >&2
|
|
|
|
else
|
2009-08-23 11:26:33 +00:00
|
|
|
/usr/sbin/babeld -D -I $pidfile $interfaces
|
2008-05-29 20:58:34 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
[ -e $pidfile ] && kill $(cat $pidfile)
|
|
|
|
[ -e $pidfile ] && sleep 2
|
|
|
|
[ -e $pidfile ] && sleep 4
|
2009-04-19 20:32:11 +00:00
|
|
|
[ -e $pidfile ] && echo "Failed to stop babel ($pidfile still exists)."
|
2008-05-29 20:58:34 +00:00
|
|
|
}
|