tomcat
tomcat启动脚本
#!/bin/bash # chkconfig: 2345 74 44 # description: Tomcat is a Java Servlet Container . /etc/profile TOMCAT_HOME=/application/tomcat/ start () { TOMCAT_PID=`ps -ef |grep "$TOMCAT_HOME" |grep -v "grep" |awk ‘{print $2}‘` if [ -z $TOMCAT_PID ];then /bin/bash $TOMCAT_HOME/bin/startup.sh else echo "$0 is running" fi } stop () { TOMCAT_PID=`ps -ef |grep "$TOMCAT_HOME" |grep -v "grep" |awk ‘{print $2}‘` if [ -z $TOMCAT_PID ];then echo "$0 is not running" else echo "shutting down $0" kill -9 "$TOMCAT_PID" && echo "PID $TOMCAT_PID killed." fi } status () { TOMCAT_PID=`ps -ef |grep "$TOMCAT_HOME" |grep -v "grep" |awk ‘{print $2}‘` if [ -z $TOMCAT_PID ];then echo "$0 is not running" else echo "$0 is running PID is $TOMCAT_PID" fi } case $1 in start) start #tail -f $TOMCAT_HOME/logs/catalina.out ;; stop) stop ;; status) status ;; restart) stop start #tail -f $TOMCAT_HOME/logs/catalina.out ;; *) echo "Usage:$0 {start|stop|status|restart}." ;; esac
本文出自 “逗哥笔记” 博客,请务必保留此出处http://qiuyt.blog.51cto.com/1229789/1972095
原文地址:http://qiuyt.blog.51cto.com/1229789/1972095