Annotation of embedaddon/quagga/redhat/watchquagga.init, revision 1.1.1.2

1.1       misho       1: #!/bin/bash
                      2: # chkconfig: 2345 17 83
1.1.1.2 ! misho       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
1.1       misho       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
1.1.1.2 ! misho      20: PROG="watchquagga"
        !            21: cmd=watchquagga
        !            22: LOCK_FILE=/var/lock/subsys/watchquagga
1.1       misho      23: 
                     24: case "$1" in
                     25:   start)
1.1.1.2 ! misho      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
1.1       misho      34:        RETVAL=$?
1.1.1.2 ! misho      35:        [ $RETVAL -eq 0 ] && touch $LOCK_FILE
1.1       misho      36:        echo
                     37:        ;;
                     38:   stop)
1.1.1.2 ! misho      39:        echo -n $"Shutting down $PROG: "
        !            40:        killproc $cmd
1.1       misho      41:        RETVAL=$?
1.1.1.2 ! misho      42:        [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
1.1       misho      43:        echo
                     44:        ;;
1.1.1.2 ! misho      45:   restart|reload|force-reload)
        !            46:        $0 stop
        !            47:        $0 start
1.1       misho      48:        RETVAL=$?
1.1.1.2 ! misho      49:        ;;
        !            50:   condrestart|try-restart)
        !            51:        if [ -f $LOCK_FILE ]; then
        !            52:                $0 stop
1.1       misho      53:                $0 start
1.1.1.2 ! misho      54:        fi
1.1       misho      55:        RETVAL=$?
1.1.1.2 ! misho      56:        ;;
1.1       misho      57:   status)
1.1.1.2 ! misho      58:        status $cmd
1.1       misho      59:        RETVAL=$?
1.1.1.2 ! misho      60:        ;;
1.1       misho      61:   *)
1.1.1.2 ! misho      62:        echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
        !            63:        exit 2
1.1       misho      64: esac
                     65: 
                     66: exit $RETVAL

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>