#!/bin/sh
#
# pimd        Starts pimd.
#
#
# chkconfig:	2345 85 40
# description:	pimd is a PIM-SM multicast routing daemon
#

# Source function library
. /etc/rc.d/init.d/functions

# Get network config
. /etc/sysconfig/network

# Get service config
if [ -f /etc/sysconfig/pimd ] ; then
        . /etc/sysconfig/pimd
fi

# See how we were called.
case "$1" in
  start)
	# Check if the service is already running?
	if [ ! -f /var/lock/subsys/pimd ]; then
		show "Starting PIM-SM multicast routing daemon"
		daemon pimd
	else
		echo "pimd already is running"
	fi
	touch /var/lock/subsys/pimd
	;;
    stop)	
	show "Stopping PIM-SM multicast routing daemon"
	killproc pimd
	rm -f /var/lock/subsys/pimd
	;;
  status)
	status pimd
	;;
  reload)
	killproc pimd -HUP
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart|reload}"
	exit 1
esac

exit 0

