startTomcat.sh
#!/bin/sh
. ~/.bash_profile
echo "" > ${TOMCAT_HOME}/logs/catalina.out;
sh ${TOMCAT_HOME}/bin/startup.sh
tail -f ${TOMCAT_HOME}/logs/catalina.out
stopTomcat.sh
#!/bin/sh
#set -x
. ~/.bash_profile
sh ${TOMCAT_HOME}/bin/shutdown.sh
proc_count=`ps -ef | grep -v grep | grep tomcat | wc -l`
if [ ${proc_count} -gt 0 ];then
ps -ef |grep -v grep | grep tomcat | awk '{print $2}' | xargs kill -9;
fi