#!/bin/bash
if [ $# -eq 0 ]; then
echo "请选择要执行的参数start|stop|restart"
read param
fi
if [ $# -gt 1 ]; then
echo "参数大于1个:[bash starttomcat.sh start| stop | restart]"
exit
fi
if [ !-n $param ]; then
param=$1
fi
case $param in
'start')
/usr/local/apache/bin/startup.sh
;;
'stop')
/usr/local/apache/bin/shutdown.sh
;;
'restart')
netstat -tnlp | grep 8080
if [ $? -eq 0 ]; then
/usr/local/apache/bin/shutdown.sh
sleep 10
/usr/local/apache/bin/startup.sh
else
/usr/local/apache/bin/startup.sh
fi
esac
Linux学习--Tomcat启动脚本
于 2022-08-16 08:03:28 首次发布