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