]> git.sommitrealweird.co.uk Git - quagga-debian.git/blob - redhat/zebra.init
New upstream release and new maintainer
[quagga-debian.git] / redhat / zebra.init
1 #!/bin/bash
2 # chkconfig: - 15 85
3 # config: /etc/quagga/zebra.conf
4
5 ### BEGIN INIT INFO
6 # Provides: zebra
7 # Short-Description: GNU Zebra routing manager
8 # Description: GNU Zebra routing manager
9 ### END INIT INFO
10
11 # source function library
12 . /etc/rc.d/init.d/functions
13
14 # Get network config
15 . /etc/sysconfig/network
16
17 # quagga command line options
18 . /etc/sysconfig/quagga
19
20 RETVAL=0
21 PROG="zebra"
22 cmd=zebra
23 LOCK_FILE=/var/lock/subsys/zebra
24 CONF_FILE=/etc/quagga/zebra.conf
25
26 case "$1" in
27   start)
28         # Check that networking is up.
29         [ "${NETWORKING}" = "no" ] && exit 1
30
31         # The process must be configured first.
32         [ -f $CONF_FILE ] || exit 6
33         if [ `id -u` -ne 0 ]; then
34                 echo $"Insufficient privilege" 1>&2
35                 exit 4
36         fi
37
38         echo -n $"Starting $PROG: "
39         /sbin/ip route flush proto zebra
40         daemon $cmd -d $ZEBRA_OPTS -f $CONF_FILE
41         RETVAL=$?
42         [ $RETVAL -eq 0 ] && touch $LOCK_FILE
43         echo
44         ;;
45   stop)
46         echo -n $"Shutting down $PROG: "
47         killproc $cmd
48         RETVAL=$?
49         [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
50         echo
51         ;;
52   restart|reload|force-reload)
53         $0 stop
54         $0 start
55         RETVAL=$?
56         ;;
57   condrestart|try-restart)
58         if [ -f $LOCK_FILE ]; then
59                 $0 stop
60                 $0 start
61         fi
62         RETVAL=$?
63         ;;
64   status)
65         status $cmd
66         RETVAL=$?
67         ;;
68   *)
69         echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
70         exit 2
71 esac
72
73 exit $RETVAL