#!/bin/sh
#
# hdapsd - disk protection user-space daemon
#
# chkconfig: - 11 91
# description: disk protection user-space daemon
#
# executable: /usr/sbin/hdapsd

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

[ -x /usr/sbin/hdapsd ] || exit 1

[ -e /etc/sysconfig/hdapsd ] && . /etc/sysconfig/hdapsd

RETVAL=0

start(){
	echo -n $"Starting hdaps daemon: "
	daemon -5 /usr/sbin/hdapsd -f -l -d sda $HDAPSD_OPTIONS
	RETVAL=$?
	echo
	return $RETVAL
}

stop(){
	echo -n $"Stopping hdaps daemon: "
	killproc hdapsd
	RETVAL=$?
	echo
	return $RETVAL
}

restart(){
	stop
	start
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		restart
		;;
	status)
		status hdapsd
		;;
	*)
		echo $"Usage: $0 {start|stop|restart|status}"
		RETVAL=1
esac

exit $RETVAL
