source /etc/profile
a_file=/home/test/tomcat/webapps/ROOT
a_cache=/home/test/tomcat/work/Catalina/localhost
a_pid=`ps aux|grep tomcat|grep test|grep jar|grep -v grep|awk ‘{print $2}‘`
if [ "$a_pid" != "" ];then
nohup /home/test/tomcat/bin/shutdown.sh >/dev/null 2>&1 &
kill -9 $a_pid
fi
if [ -d "$a_cache" ];then
rm -rf $a_cache
fi
if [ -d "$a_file" ];then
rm -rf $a_file
fi