Linux用Tomcat重新启动脚本

来源:互联网 发布:英文域名注册查询 编辑:程序博客网 时间:2024/04/30 18:53

#!/bin/sh

bin=/opt/apache-tomcat-8.5.11/bin

pid=$(ps aux | grep tomcat | grep -v grep | grep -v restart | grep ${bin})


if [ -n "${pid}" ]; then

echo"Shutdown..."

sh${bin}/shutdown.sh

sleep 3


pid=$(ps aux | grep tomcat | grep -v grep | grep -v restart | grep ${bin})

if [ -n "${pid}" ]; then

kill -9 ${pid}

sleep 1

fi

fi

echo"Startup..."sh

${bin}/startup.sh

if [ "$1" = "-v" ]; then

tail-f${bin}/../logs/catalina.out

fi

0 0