#!/bin/sh
#
#	/etc/init.d/ipxripd
#
#	ipxripd is an implementation of Novell's RIP and SAP protocols.
#	Script for stating daemon /usr/sbin/ipxripd
#
#   chkconfig: 345 11 89
#   description: ipxripd is an implementation of Novell's RIP and SAP
#                protocols.
#   processname: ipxripd

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


IPX=no
IPXRIPD=/usr/sbin/ipxripd
[ -x "$IPXRIPD" ] || exit

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = yes ] || exit

# Check basic IPX config
[ "$IPX" = yes ] || exit


RETVAL=0
LOCKFILE=/var/lock/subsys/ipxripd

start()
{
	echo -n "Starting ipxripd: "
	# start daemons, perhaps with the daemon function, for example:
	daemon "$IPXRIPD"
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch "$LOCKFILE"
	return $RETVAL
}	

stop()
{
	echo -n "Shutting down ipxripd: "
	# stop daemons, perhaps with the killproc function, for example:
	killproc "$IPXRIPD"
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f "$LOCKFILE"
	return $RETVAL
}

restart()
{
	stop
	start
}

reload()
{
    restart
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	reload)
		reload
		;;
	restart)
		restart
		;;
	condstop)
		# Stop the servce if it is already running, for example:
		if [ -e "$LOCKFILE" ]; then
			stop
		fi
		;;
	condrestart)
		# Restart the servce if it is already running, for example:
		if [ -e "$LOCKFILE" ]; then
			restart
		fi
		;;
	status)
		# report the status of the daemons in free-form format,
		# perhaps with the status function, for example:
		status "$IPXRIPD"
		RETVAL=$?
		;;
	*)
		echo "Usage: ${0##*/} {start|stop|reload|restart|condstop|condrestart|status[|probe]}"
		RETVAL=1
esac

exit $RETVAL
