#!/bin/sh
#
# ipxripd	IPX RIP/SAP routing daemon
#
# chkconfig:	345 35 89
#
# description:	ipxripd is an implementation of Novell's RIP and SAP protocols. \
#		It automagically builds and updates IPX routing table \
#		in the Linux kernel. \
#		Usefull when trying to get a Linux box to act as an IPX router.

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

# Get network config
. /etc/sysconfig/network

# Get service config
[ -f /etc/sysconfig/ipxripd ] && . /etc/sysconfig/ipxripd

# Check that networking is up.
if is_no "${NETWORKING}"; then
	msg_Network_Down ipxripd
	exit 1
fi


# See how we were called.
case "$1" in
  start)
	# Check if the service is already running?
	if [ ! -f /var/lock/subsys/ipxripd ]; then
		msg_starting ipxripd
		OPTIONS=""
		[ "$PASSIVE" = "yes" ] && OPTIONS="-p"
		[ -n "$LOGFILE" ] && OPTIONS="$OPTIONS -l $LOGFILE"
		[ -n "$TICKSFILE" ] && OPTIONS="$OPTIONS -t $TICKSFILE"
		daemon ipxd $OPTIONS
		RETVAL=$?
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ipxripd
	else
		msg_Already_Running ipxripd
		exit 1
	fi
	;;
  stop)
	msg_stopping ipxripd
	killproc ipxd
	rm -f /var/lock/subsys/ipxripd
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  status)
	status ipxd
	;;
  *)
	msg_Usage "$0 {start|stop|status|restart|reload}"
	exit 1
esac

exit $RETVAL
