#!/bin/sh

###############################################################################
#
# chkconfig: 2345 99 01
#
# description: Starts the system daemon monitor application.
#
###############################################################################

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

DMN_NAME=dmnASMCheck
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 sysguard: "
	daemon $DMN_FULL 
	RETVAL=$?
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$DMN_NAME
	echo
        ;;
  stop)
        # Stop the daemon.
	echo -n "Stopping sysguard: "
	killproc $DMN_NAME 2 
        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
