#! /bin/bash## /etc/init.d/tomcat# init script for tomcat process# processname: tomcat# description: tomcat is a j2ee server# chkconfig: 2345 86 16# description: Start up the tomcat servlet engineif [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
elseecho-e"\atomcat: unable to locate functions libs. can not continue."exit -1fi
RETVAL=$?
CATALINA_HOME=/root/tomcat7
echo$1case"$1"in
start)
if [ -f${CATALINA_HOME}/bin/startup.sh ]; thenecho"start up the tomcat"${CATALINA_HOME}/bin/startup.sh
fi
;;
stop)
if [ -f${CATALINA_HOME}/bin/shutdown.sh ]; thenecho"stop the tomcat"${CATALINA_HOME}/bin/shutdown.sh
fi
;;
*)
echo-e"Usage: $0 {start|stop}"exit1
;;
esacexit$RETVAL