File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / pimd / redhat / pimd.init
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jun 12 07:59:38 2017 UTC (7 years, 4 months ago) by misho
Branches: pimd, MAIN
CVS tags: v2_3_2, HEAD
pimd 2.3.2

    1: #!/bin/sh
    2: #
    3: # pimd		Starts pimd.
    4: #
    5: #
    6: # chkconfig:	2345 85 40
    7: # description:	pimd is a PIM-SM multicast routing daemon
    8: #
    9: 
   10: # Source function library
   11: . /etc/rc.d/init.d/functions
   12: 
   13: # Get network config
   14: . /etc/sysconfig/network
   15: 
   16: # Check that networking is up.
   17: if is_yes "${NETWORKING}"; then
   18: 	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
   19: 		msg_network_down pimd
   20: 		exit 1
   21: 	fi
   22: else
   23: 	exit 0
   24: fi
   25: 
   26: # Get service config
   27: if [ -f /etc/sysconfig/pimd ]; then
   28: 	. /etc/sysconfig/pimd
   29: fi
   30: 
   31: RETVAL=0
   32: # See how we were called.
   33: case "$1" in
   34:   start)
   35: 	# Check if the service is already running?
   36: 	if [ ! -f /var/lock/subsys/pimd ]; then
   37: 		show "Starting PIM-SM multicast routing daemon"
   38: 		daemon pimd
   39: 		RETVAL=$?
   40: 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pimd
   41: 	else
   42: 		msg_already_running pimd
   43: 	fi
   44: 	;;
   45:   stop)
   46: 	if [ -f /var/lock/subsys/pimd ]; then
   47: 		show "Stopping PIM-SM multicast routing daemon"
   48: 		killproc pimd
   49: 		rm -f /var/lock/subsys/pimd
   50: 	else
   51: 		msg_not_running pimd
   52: 	fi
   53: 	;;
   54:   status)
   55: 	status pimd
   56: 	exit $?
   57: 	;;
   58:   reload|force-reload)
   59: 	if [ -f /var/lock/subsys/pimd ]; then
   60: 		show "Reloading PIM-SM multicast routing daemon"
   61: 		killproc pimd -HUP
   62: 		RETVAL=$?
   63: 	else
   64: 		msg_not_running pimd >&2
   65: 		exit 7
   66: 	fi
   67: 	;;
   68:   restart)
   69: 	$0 stop
   70: 	$0 start
   71: 	exit $?
   72: 	;;
   73:   *)
   74: 	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
   75: 	exit 3
   76: esac
   77: 
   78: exit $RETVAL

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