#!/bin/sh
########################################################################
# Begin $rc_base/init.d/watchdog
#
# Description : watchdog daemon initscript
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

if [ -e "/etc/sysconfig/watchdog" ]; then
	. /etc/sysconfig/watchdog
fi

case "${1}" in
	start)
		if [ -n "${watchdog_module}" ]; then
			modprobe -q "${watchdog_module}" 2>/dev/null
		fi

		boot_mesg "Starting watchdog daemon..."
		loadproc /usr/sbin/watchdog ${watchdog_options}
		;;

	stop)
		boot_mesg "Stopping watchdog daemon..."
		killproc /usr/sbin/watchdog
		;;

	restart)
		${0} stop
		sleep 1
		${0} start
		;;

	status)
		statusproc /usr/sbin/watchdog
		;;

	*)
		echo "Usage: ${0} {start|stop|restart|status}"
		exit 1
		;;
esac

# End $rc_base/init.d/watchdog
