+ sayonara old_pid!
[jleu-quagga.git] / redhat / zebra.init
blob8caae1f167345cb9232bdfdd5ac9272c6fd5b9f8
1 #!/bin/bash
3 # chkconfig: 2345 15 85
4 # description: GNU Zebra routing manager
6 # processname: zebra
7 # config: /etc/quagga/zebra.conf
9 # source function library
10 . /etc/rc.d/init.d/functions
12 # quagga command line options
13 . /etc/sysconfig/quagga
15 # Check that networking is up.
16 [ "${NETWORKING}" = "no" ] && exit 0
18 # The process must be configured first.
19 [ -f /etc/quagga/zebra.conf ] || exit 0
21 RETVAL=0
23 prog="zebra"
25 case "$1" in
26 start)
27 echo -n $"Starting $prog: "
29 /sbin/ip route flush proto zebra
31 daemon /usr/sbin/zebra -d $ZEBRA_OPTS
32 RETVAL=$?
33 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
34 echo
36 stop)
37 echo -n $"Shutting down $prog: "
38 killproc zebra
39 RETVAL=$?
40 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra
41 echo
43 restart|reload)
44 $0 stop
45 $0 start
46 RETVAL=$?
48 condrestart)
49 if [ -f /var/lock/subsys/zebra ]; then
50 $0 stop
51 $0 start
53 RETVAL=$?
55 status)
56 status zebra
57 RETVAL=$?
60 echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
61 exit 1
62 esac
64 exit $RETVAL