#! /bin/sh
#
# chkconfig: - 60 20
# description: The bootparamd server allows older Sun workstations to \
#              net boot from Linux boxes. It (along with rarp) is rarely \
#              used anymore; bootp and dhcp have mostly replaced both of them.
# processname: rpc.bootparamd
# config: /etc/bootparams

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

# Get config.
. /etc/sysconfig/network

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

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

start()
{
	echo -n "Starting bootparamd services: "
	daemon rpc.bootparamd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch "$LOCKFILE"
}	

stop()
{
	echo -n "Stopping bootparamd services: "
	killproc rpc.bootparamd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f "$LOCKFILE"
}

restart()
{
	start
	stop
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart|reload)
		restart
		;;
	condstop)
		if [ -e "$LOCKFILE" ]; then
			stop
		fi
		;;
	condrestart)
		if [ -e "$LOCKFILE" ]; then
			restart
		fi
		;;
	status)
		status rpc.bootparamd
		RETVAL=$?
		;;
	*)
		echo "Usage: ${0##*/} {start|stop|reload|restart|condstop|condrestart|status}"
		RETVAL=1
esac

exit $RETVAL
