#!/bin/sh
#
# boom_srv init: Startup and kill script for the BOOM Server
#
#Do not change the values for BOOM_SERVER, 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_SERVER variable to the server's installation
#directory. 
#BOOM_SERVER=
#export BOOM_SERVER
#PATH=$PATH:$BOOM_SERVER
#export PATH
#################
### BEGIN INIT INFO
# Provides:          boom_srv
# Default-Start:     3 4 5
# Default-Stop:      0 1 2 6
# Required-Start: 
# Required-Stop: 
# Should-Start: $network $remote_fs mysql
# Should-Stop: 
# Short-Description: boom server daemon
# Description:       boom server daemon init script
### END INIT INFO
#

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

case "$1" in

    "start_msg") echo "Starting BOOM Server" ;;

    "start") cd $BOOM_SERVER
             $BOOM_SERVER/boom_srv -start
			 exit $? ;;

  "status") cd $BOOM_SERVER
            $BOOM_SERVER/boom_srv -status
            exit $? ;;

  "restart") cd $BOOM_SERVER
             $BOOM_SERVER/boom_srv -restart
			 exit $? ;;
 
    "stop_msg") echo "Terminating BOOM Server" ;;

    "stop") cd $BOOM_SERVER
            $BOOM_SERVER/boom_srv -stop
            exit $? ;;

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

exit 0;

