#!/bin/sh
#
# boom_agent init: Startup and kill script for the BOOM Agent
#
#Do not change the values for BOOM_ROOT, PATH or JAVA_BIN if
#you are going to use the install script! These will be
#automatically set.
#For manual installations without the install script
#just set the BOOM_ROOT variable to the agent's installation
#directory and others similar as shown below. 
#BOOM_ROOT=
#export BOOM_ROOT
#JAVA_BIN=/usr/local/bin/java
#PATH=${JAVA_BIN}:${BOOM_ROOT}:${BOOM_ROOT}/spi:/sbin:/usr/sbin:/bin:/usr/bin:${PATH}
#export PATH
#################
### BEGIN INIT INFO
# Provides:          boom_agt
# Default-Start:     3 4 5
# Default-Stop:      0 1 2 6
# Required-Start: 
# Required-Stop: 
# Should-Start: $network $remote_fs
# Should-Stop: 
# Short-Description: boom agent daemon
# chkconfig: 345 90 10
# Description:       boom agent daemon init script
### END INIT INFO
#

if [ -z "$BOOM_ROOT" ]
then
  echo "Error: You must set BOOM_ROOT to the Agent's Install directory."
  exit 1
fi

case "$1" in

    "start_msg") echo "Starting BOOM Agent" ;;

    "start") cd $BOOM_ROOT
             $BOOM_ROOT/boom_agt -start
			 exit $? ;;

  "status") cd $BOOM_ROOT
            $BOOM_ROOT/boom_agt -status
            exit $? ;;

  "restart") cd $BOOM_ROOT
             $BOOM_ROOT/boom_agt -restart
			 exit $? ;;
 
    "stop_msg") echo "Terminating BOOM Agent" ;;

    "stop") cd $BOOM_ROOT
            $BOOM_ROOT/boom_agt -stop
            exit $? ;;

    *) echo "Usage: boom_agt start|restart|status|stop"
            ;;
esac

exit 0;

