#!/bin/sh

###############################################################################
#
# chkconfig: 2345 01 99
#
# description: Periodically resets the watchdog timer.
#
###############################################################################

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

DMN_NAME=dmnWDTCheck
DMN_FULL=/usr/ins/intel/bin/asm/$DMN_NAME

[ -f $DMN_FULL ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
        # Start the daemon.
        echo -n "Starting WDT monitor: "
        daemon $DMN_FULL
	RETVAL=$?
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$DMN_NAME
	echo
        ;;
  stop)
        # Stop the daemon.
        echo -n "Stopping WDT monitor: "
        killproc $DMN_NAME
	RETVAL=$?
 	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$DMN_NAME
	echo
        ;;
  status)
	# Get the daemon status.
	status $DMN_NAME
	RETVAL=$?
	;;
  restart)
	# Restart the deamon.
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
        echo "Usage: $DMN_NAME {start|stop|status|restart}"
        exit 1
esac

exit $RETVAL
