标签:
先占坑,回头补充完善哈
#!/bin/bash
# Program:
# This program is used to stop tomcat.
# History:
# 2016/09/11 XH First release
pid=`ps -ef|grep tomcat|grep -v grep|awk ‘{print $2}‘`
if [ $pid ]
then
echo ‘Tomcat is already running..‘
else
/opt/tomcat7/bin/startup.sh
echo ‘Tomcat has just been started..‘
tail -f /opt/tomcat7/logs/catalina.out
fi
pid=`ps -ef|grep tomcat|grep -v grep|awk ‘{print $2}‘`
if [ $pid ]
then
echo ‘Tomcat is alread running..pid is --> $pid‘
else
echo ‘Tomcat has just been started..‘
fi
标签:
原文地址:http://www.cnblogs.com/hywht/p/5864349.html