packages/ipv6/babel/files/babel.init
florian f51e8b9e96 Upgrade babel to 0.13 (#3480) (#3478)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@11292 3c298f89-4303-0410-b956-a3cf2f4a3e73
2008-05-29 20:58:34 +00:00

33 lines
647 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=70
pidfile=/var/run/babel.pid
babel_config() {
local cfg="$1"
config_get interfaces "$cfg" interfaces
}
start() {
if [ -x /etc/init.d/ahcpd ] ; then
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
/usr/bin/babel -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 ahcpd ($pidfile still exists)."
}