#! /bin/bash
#
# /etc/init.d/MICE-reactiondaemon
#
### BEGIN INIT INFO
# Provides:       MICE-reactiondaemon
# Required-Start: $network MICE-dataforwarder
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Description:    M-ICE: Starts ReactionDaemon
### END INIT INFO

. /etc/rc.status
#. /etc/rc.config

return=$rc_done
case "$1" in
    start)
	echo -n "M-ICE IDS: Starting ReactionDaemon"
	startproc /usr/sbin/reactiondaemon || return=$rc_failed
	echo -e "$return"
	;;
    stop)
	echo -n "M-ICE IDS: Stopping ReactionDaemon"
	killproc /usr/sbin/reactiondaemon || return=$rc_failed
	echo -e "$return"
	;;
    restart)
	$0 stop && $0 start
	;;
    status)
	echo "M-ICE IDS: Status ReactionDaemon:"
	checkproc -v /usr/sbin/reactiondaemon || return=$rc_failed
        echo -e "$return"
	;;
    *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
esac
test "$return" = "$rc_done" || exit 1
exit 0

