Description: 8 tomcat running on a single server
Case in the way:
#!/bin/Bash#reboot Tomcat!!!#Author: FansikEcho-E"\033[1;42;31mchoice TOMCATNO REBOOT!!! \033[0m"Cat<<EOF1: Reboot tomcat80812: Reboot tomcat80823: Reboot tomcat80834: Reboot tomcat80845: Reboot tomcat80856: Reboot tomcat80867: Reboot tomcat80878: Reboot Tomcat8088eofread-TTen-P"Enter a mnumber:"Numbernumber=${number:-1} Caseinch 1) proid=`PS-ef |greptomcat8081 |grepjava |awk '{print $}'` Kill-9$proIdSleep 5CD/usr/tomcats/tomcat8081RM-RF logs/* work./bin/startup.sh exit; 2) proid= ' Ps-ef | grep tomcat8082 | grep java | awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8082 rm-rf logs/* work ./bin/startup.sh exit;; 3) proid= ' Ps-ef | grep tomcat8083 | grep java | awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8083 rm-rf logs/* work ./bin/startup.sh exit;; 4) proid= ' Ps-ef | grep tomcat8084 | grep java | awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8084 rm-rf logs/* work ./bin/startup.sh exit;; 5) proid= ' Ps-ef | grep tomcat8085 | grep java | awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8085 rm-rf logs/* work ./bin/startup.sh exit;; 6) proid= ' Ps-ef | grep tomcat8086 | grep java | awk ' {priNT $ "kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8086 rm-rf logs/* work./bin/sta Rtup.sh exit;; 7) proid= ' Ps-ef | grep tomcat8087 | grep java | awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8087 rm-rf logs/* work ./bin/startup.sh exit;; 8) proid= ' Ps-ef | grep tomcat8088 | grep java | awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8088 rm-rf logs/* work ./bin/startup.sh exit;; *) echo "Please input 1-8" Esac
Restart the Tomcat script