tomcat 的 start/stop shell script.

#!/bin/bash
echo "hello,this is the tomcat9 start and stop shell control script."
echo "you can input 1 to start tomcat9,0 to stop tomcat9."
echo "please input your operate parameter..."shell

read is_start_or_stop_tomcat
if [ $is_start_or_stop_tomcat == 1 ]
 then
  echo "your input is ${is_start_or_stop_tomcat},start tomcat ..."
  /usr/local/apache-tomcat-9.0.0.M19/bin/startup.sh
elif [ $is_start_or_stop_tomcat == 0 ]
 then
  echo "your input is ${is_start_or_stop_tomcat},stop tomcat ..."
  /usr/local/apache-tomcat-9.0.0.M19/bin/shutdown.sh
else
 echo "input error!"
fi
echo "operate done."
echo "wait for 10 seconds and grep tomcat info ..."
sleep 10s
ps -ef|grep tomcat
 apache

相關文章
相關標籤/搜索