port=$(lsof -i:8080)
str="java"
result=$(echo $port | grep ${str})
if test $result!=""
then
echo "启动 tomcat "
sh /www/server/tomcat/bin/catalina.sh run
else
echo "tomcat正常运行"
fi
# 检测 mq 是否运行
port=$(lsof -i:8161)
str="java"
result=$(echo $port | grep ${str})
if test $result!=""
then
echo "启动 mq "
cd /www/server/apache-activemq-5.15.3/bin
./activemq start
else
echo "mq正常运行"
fi