]> git.pld-linux.org Git - packages/quagga.git/blob - quagga-babeld.init~
- adaptarized
[packages/quagga.git] / quagga-babeld.init~
1 #!/bin/sh
2 #
3 # bgpd          Starts the Dynamic Route Daemon
4 #
5 # chkconfig:    345 15 84
6 #
7 # description:  Dynamic Route Daemon for IPv4 and IPv6 routers
8 #
9 # processname:  bgpd
10 # config:       /etc/zebra/bgpd.conf
11
12
13 # Source function library
14 . /etc/rc.d/init.d/functions
15
16 # Get network config
17 . /etc/sysconfig/network
18
19 # Get service config
20 [ -f /etc/sysconfig/bgpd ] && . /etc/sysconfig/bgpd
21
22 # Check that networking is up.
23 if is_yes "${NETWORKING}"; then
24         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
25                 msg_network_down bgpd
26                 exit 1
27         fi
28 else
29         exit 0
30 fi
31
32 RETVAL=0
33 # See how we were called.
34 case "$1" in
35   start)
36         # Check if the services are already running?
37         if [ ! -f /var/lock/subsys/bgpd ]; then
38                 FLAGS="--daemon"
39                 is_yes "$RETAIN_ROUTES" && FLAGS="$FLAGS --retain"
40                 is_yes "$NO_KERNEL" && FLAGS="$FLAGS --no_kernel"
41                 [ -n "$VTY_ADDR" ] && FLAGS="$FLAGS --vty_addr $VTY_ADDR"
42                 [ -n "$VTY_PORT" ] && FLAGS="$FLAGS --vty_port $VTY_PORT"
43                 msg_starting bgpd
44                 daemon bgpd $FLAGS
45                 RETVAL=$?
46                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
47         else
48                 msg_already_running "bgpd"
49         fi
50         ;;
51   stop)
52         if [ -f /var/lock/subsys/bgpd ]; then
53                 # Stop daemons.
54                 msg_stopping "bgpd"
55                 killproc bgpd
56                 rm -f /var/lock/subsys/bgpd
57         else
58                 msg_not_running bgpd
59         fi
60         ;;
61   status)
62         status bgpd
63         exit $?
64         ;;
65   restart|force-reload)
66         $0 stop
67         $0 start
68         exit $?
69         ;;
70   *)
71         msg_usage "$0 {start|stop|restart|force-reload|status}"
72         exit 3
73 esac
74
75 exit $RETVAL
This page took 0.08626 seconds and 3 git commands to generate.