2017-09-15  9,157 views 评论

Linux下重启tomcat脚本

#!/bin/sh
pid=`ps aux | grep tomcat | grep -v grep | grep -v retomcat | awk '{print $2}'`
echo $pid
if [ -n "$pid" ]
then
{
echo ===========shutdown================
pid=`ps aux | grep tomcat | grep -v grep | grep -v retomcat | awk '{print $2}'`
if [ -n "$pid" ]
then
{
echo ========kill tomcat begin==============
echo $pid
kill -9 $pid
echo ========kill tomcat end==============
}
fi
sleep 2
}
fi
echo ===========startup==============
service tomcat start

本文转自:hunterli

原创文章或网络摘录,转载请注明: 转载自守候的时光

本文链接地址: Linux下重启tomcat脚本

打赏

给我留言

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: