]> git.sommitrealweird.co.uk Git - quagga-debian.git/blob - redhat/watchquagga.init
New upstream version 1.2.4
[quagga-debian.git] / redhat / watchquagga.init
1 #!/bin/bash
2 # chkconfig: 2345 17 83
3
4 ### BEGIN INIT INFO
5 # Provides: watchquagga
6 # Short-Description: Quagga watchdog
7 # Description: Quagga watchdog for use with Zebra
8 ### END INIT INFO
9
10 # source function library
11 . /etc/rc.d/init.d/functions
12
13 # Get network config
14 . /etc/sysconfig/network
15
16 # quagga command line options
17 . /etc/sysconfig/quagga
18
19 RETVAL=0
20 PROG="watchquagga"
21 cmd=watchquagga
22 LOCK_FILE=/var/lock/subsys/watchquagga
23
24 case "$1" in
25   start)
26         # Check that networking is up.
27         [ "${NETWORKING}" = "no" ] && exit 1
28
29         # Check that there are daemons to be monitored.
30         [ -z "$WATCH_DAEMONS" ] && exit 1
31
32         echo -n $"Starting $PROG: "
33         daemon $cmd -d $WATCH_OPTS $WATCH_DAEMONS
34         RETVAL=$?
35         [ $RETVAL -eq 0 ] && touch $LOCK_FILE
36         echo
37         ;;
38   stop)
39         echo -n $"Shutting down $PROG: "
40         killproc $cmd
41         RETVAL=$?
42         [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
43         echo
44         ;;
45   restart|reload|force-reload)
46         $0 stop
47         $0 start
48         RETVAL=$?
49         ;;
50   condrestart|try-restart)
51         if [ -f $LOCK_FILE ]; then
52                 $0 stop
53                 $0 start
54         fi
55         RETVAL=$?
56         ;;
57   status)
58         status $cmd
59         RETVAL=$?
60         ;;
61   *)
62         echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
63         exit 2
64 esac
65
66 exit $RETVAL