paulwong

          My Links

          Blog Stats

          常用鏈接

          留言簿(67)

          隨筆分類(1393)

          隨筆檔案(1151)

          文章分類(7)

          文章檔案(10)

          相冊

          收藏夾(2)

          AI

          Develop

          E-BOOK

          Other

          養生

          微服務

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          60天內閱讀排行

          TOMCAT重啟/啟動/停止腳本


          #!/bin/bash
          #tomcat start script
          # ./tomcat_start.sh start|restart|stop

          RETVAL=0

          start() {
           echo -n "Tomcat Starting"
           echo

           /root/java/apache-tomcat-7.0.47/bin/startup.sh
          }

          stop() {
           echo -n "Tomcat Stop"
           echo " port "$1
           if [ ! "$1" ];then
             echo "Usage port "
             exit 1
           fi
           pid=`netstat -tpln|grep $1 | awk '{print $7}' | awk -F/ '{print $1}'`

           if [ -n "$pid" ];then
              echo $pid
             echo "kill -9 pid "$pid
             kill -9 $pid
           fi

          }

          restart() {
           echo -n "Tomcat restart"
           echo
           stop $1
           start
          }

          case "$1" in
           start)
                start;;
           stop)
             stop "$2";;
           restart)
                restart "$2";;
           *)
              echo $"Usage: $0 {start|stop|restart}"
           exit 1
          esac

          exit $RETVAL

          posted on 2015-06-24 10:21 paulwong 閱讀(781) 評論(0)  編輯  收藏 所屬分類: TOMCAT

          主站蜘蛛池模板: 金昌市| 磐安县| 稷山县| 承德市| 桦甸市| 白水县| 奉节县| 河曲县| 绥化市| 泽州县| 普兰店市| 安阳县| 涟源市| 思南县| 板桥市| 阿图什市| 六安市| 乌兰察布市| 荣成市| 中方县| 天长市| 泽州县| 吉木萨尔县| 神池县| 文山县| 泌阳县| 全南县| 鄂托克旗| 缙云县| 永寿县| 淮安市| 桐梓县| 松滋市| 民乐县| 香河县| 洛宁县| 云浮市| 西城区| 金门县| 遂昌县| 新安县|