Annotation of embedaddon/quagga/redhat/ripd.init, revision 1.1.1.2
1.1 misho 1: #!/bin/bash
1.1.1.2 ! misho 2: # chkconfig: - 16 84
1.1 misho 3: # config: /etc/quagga/ripd.conf
4:
1.1.1.2 ! misho 5: ### BEGIN INIT INFO
! 6: # Provides: ripd
! 7: # Short-Description: RIP routing engine
! 8: # Description: RIP routing engine for use with Zebra
! 9: ### END INIT INFO
! 10:
1.1 misho 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
1.1.1.2 ! misho 21: PROG="ripd"
! 22: cmd=ripd
! 23: LOCK_FILE=/var/lock/subsys/ripd
! 24: CONF_FILE=/etc/quagga/ripd.conf
1.1 misho 25:
26: case "$1" in
27: start)
1.1.1.2 ! misho 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: daemon $cmd -d $RIPD_OPTS -f $CONF_FILE
1.1 misho 40: RETVAL=$?
1.1.1.2 ! misho 41: [ $RETVAL -eq 0 ] && touch $LOCK_FILE
1.1 misho 42: echo
43: ;;
44: stop)
1.1.1.2 ! misho 45: echo -n $"Shutting down $PROG: "
! 46: killproc $cmd
1.1 misho 47: RETVAL=$?
1.1.1.2 ! misho 48: [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
1.1 misho 49: echo
50: ;;
1.1.1.2 ! misho 51: restart|reload|force-reload)
! 52: $0 stop
! 53: $0 start
1.1 misho 54: RETVAL=$?
1.1.1.2 ! misho 55: ;;
! 56: condrestart|try-restart)
! 57: if [ -f $LOCK_FILE ]; then
! 58: $0 stop
1.1 misho 59: $0 start
1.1.1.2 ! misho 60: fi
1.1 misho 61: RETVAL=$?
1.1.1.2 ! misho 62: ;;
1.1 misho 63: status)
1.1.1.2 ! misho 64: status $cmd
1.1 misho 65: RETVAL=$?
1.1.1.2 ! misho 66: ;;
1.1 misho 67: *)
1.1.1.2 ! misho 68: echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
! 69: exit 2
1.1 misho 70: esac
71:
72: exit $RETVAL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>