#! /bin/sh
#
# init.d/cpqarrayd
#
#   and symbolic its link
#
# /usr/sbin/cpqarrayd
#
# System startup script for the Compaq Array Monitor daemon
#
### BEGIN INIT INFO
# Provides: cpqarrayd
# Required-Start: 
# X-UnitedLinux-Should-Start: 
# Required-Stop:   
# X-UnitedLinux-Should-Stop: 
# Default-Start:  3 5 
# Default-Stop:   0 1 2 6
# Short-Description: cpqarrayd (Compaq Array Monitor)
# Description: The cpqarrayd monitors the status of Compaq Raid Arrays,\
#              and reports via syslog or traps    
### END INIT INFO


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

# Get config.
if [ -f /etc/sysconfig/cpqarrayd ]; then
        . /etc/sysconfig/cpqarrayd
fi

[ -f /usr/sbin/cpqarrayd ] || exit 0

RETVAL=0

rc_reset

# See how we were called.
case "$1" in
  start)
        echo -n "Starting cpqarrayd: "
        startproc /usr/sbin/cpqarrayd $CPQ_PARAMS
        RETVAL=$?
        rc_status -v
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cpqarrayd
        ;;
  stop)
        echo -n "Stopping cpqarrayd: "
        killproc cpqarrayd
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cpqarrayd
        ;;
  status)
        status cpqarrayd
        RETVAL=$?
        ;;
  restart|reload)
        $0 stop
        $0 start
        RETVAL=$?
        ;;
  *)
        echo "Usage: cpqarrayd {start|stop|status|restart|reload}"
        exit 1
esac

exit $RETVAL
