merge babeld from packages to packages_8.09
[openwrt/svn-archive/archive.git] / ipv6 / babel / files / babeld.init
1 #!/bin/sh /etc/rc.common
2
3 START=70
4
5 pidfile=/var/run/babeld.pid
6
7 babeld_config() {
8 local cfg="$1"
9 config_get interfaces "$cfg" interfaces
10 }
11
12 start() {
13 config_load babeld
14 config_foreach babeld_config babeld
15 mkdir -p /var/lib
16 if [ -e $pidfile ] ; then
17 echo "$pidfile exists -- not starting babel." >&2
18 else
19 /usr/sbin/babeld -D -I $pidfile $interfaces
20 fi
21 }
22
23 stop() {
24 [ -e $pidfile ] && kill $(cat $pidfile)
25 [ -e $pidfile ] && sleep 2
26 [ -e $pidfile ] && sleep 4
27 [ -e $pidfile ] && echo "Failed to stop babel ($pidfile still exists)."
28 }
29 #!/bin/sh /etc/rc.common
30
31 START=70
32
33 pidfile=/var/run/babeld.pid
34
35 babel_config() {
36 local cfg="$1"
37 config_get interfaces "$cfg" interfaces
38 }
39
40 start() {
41 if [ -x /etc/rc.d/S71ahcpd ] ; then
42 echo 'Not starting babel -- will be started by ahcpd.'
43 exit 0
44 fi
45 config_load babel
46 config_foreach babel_config babel
47 mkdir -p /var/lib
48 if [ -e $pidfile ] ; then
49 echo "$pidfile exists -- not starting babel." >&2
50 else
51 /usr/sbin/babeld -D -I $pidfile $interfaces
52 fi
53 }
54
55 stop() {
56 [ -e $pidfile ] && kill $(cat $pidfile)
57 [ -e $pidfile ] && sleep 2
58 [ -e $pidfile ] && sleep 4
59 [ -e $pidfile ] && echo "Failed to stop babel ($pidfile still exists)."
60 }