#! /bin/sh
#
# chkconfig: 2345 02 98
# description: A software watchdog
#

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

test -x /usr/sbin/watchdog || exit 0

# See how we were called.
case "$1" in
  start)
    [ -f /var/lock/subsys/kde ] && exit 0

	echo -n "Starting sofware watchdog: "
	daemon watchdog
	echo
	touch /var/lock/subsys/watchdog
	;;
  stop)
	echo -n "Stopping software watchdog: "
	killproc watchdog
	echo
	rm -f /var/lock/subsys/watchdog
	;;
  status)
	status watchdog
	;;
  restart)
	/etc/rc.d/init.d/watchdog stop
	/etc/rc.d/init.d/watchdog start
	;;
  *)
	echo "Usage: watchdog {start|stop|status|restart}"
	exit 1
esac

exit 0
