#!/bin/bash
#
# hpdmmsvc init script.
#
# chkconfig: 345 99 00
# description: HP DIMM daemon.

# Source function library.
. /etc/rc.status
. /etc/rc.config

test -x /usr/hpserver/bin/hpdmmsvc || exit 5

# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}

# Force execution if not called by a runlevel directory.
test $link = $base && START_HPDMM="yes"
test "$START_HPDMM" = yes || exit 0

#
#	See how we were called.
#
rc_reset
case "$1" in
  start)
	echo -n 'Starting HP DIMM daemon: '
	startproc /usr/hpserver/bin/hpdmmsvc
	rc_status -v
	;;
  stop)
	echo -n 'Stopping HP DIMM daemon: '
	killproc /usr/hpserver/bin/hpdmmsvc
	rc_status -v
	;;
  reload|restart)
	$0 stop
	$0 start
	rc_status
	;;
  status)
        echo -n 'Checking for process hpdmmsvc: '
	checkproc /usr/hpserver/bin/hpdmmsvc
	rc_status -v
	;;
  *)
	echo "Usage: /etc/init.d/hpdmmsvc {start|stop|restart|reload|status}"
	exit 1
esac

rc_exit
