#!/bin/bash
# chkconfig: - 85 15
# description: Tomcat Server basic start/shutdown script
# processname: tomcat
JAVA_HOME=/usr/local/jdk/jdk1.8.0_65
export JAVA_HOME
TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-8.0.30
START_TOMCAT=/usr/local/tomcat/apache-tomcat-8.0.30/bin/startup.sh
STOP_TOMCAT=/usr/local/tomcat/apache-tomcat-8.0.30/bin/shutdown.sh
start() {
echo -n "Starting tomcat: "
cd $TOMCAT_HOME
${START_TOMCAT}
echo "done."
}
stop() {
echo -n "Shutting down tomcat: "
cd $TOMCAT_HOME
${STOP_TOMCAT}
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0