#!/bin/bash
#
# Startup script for the Tomcat server
#
# chkconfig: - 83 53
# description: Starts and stops the Tomcat daemon.
# processname: tomcat
# pidfile: /var/run/tomcat.pid

export ORDERLY_HOME=%%ORDERLY_HOME%%
export JAVA_HOME=$ORDERLY_HOME/java/			#You may need to edit this line
export CATALINA_HOME=$ORDERLY_HOME/tomcat		#You may need to edit this line
export CATALINA_OPTS="-Xmx256M"
export CATALINA_PID=/var/run/tomcat.pid
export NICENESS=10

#See how we were called.
case $1 in
        start)
		sh $CATALINA_HOME/bin/shutdown.sh -force 2>&1 > /dev/null
                nice -n $NICENESS $CATALINA_HOME/bin/startup.sh
        ;;
        stop)
                sh $CATALINA_HOME/bin/shutdown.sh -force
        ;;
        restart)
                sh $CATALINA_HOME/bin/shutdown.sh -force
                nice -n $NICENESS $CATALINA_HOME/bin/startup.sh
        ;;
        *)
                echo "Usage: /etc/init.d/tomcat start|stop|restart"
        ;;
esac

exit 0

