• 重启Tomcat的脚本


    说明:一台服务器上跑了8个Tomcat

    case的方式:

    #!/bin/bash
    #reboot tomcat!!!
    #Author:fansik
    echo -e "33[1;42;31mchoice tomcatNo reboot!!!33[0m"
    cat << EOF
            1:reboot tomcat8081
            2:reboot tomcat8082
            3:reboot tomcat8083
            4:reboot tomcat8084
            5:reboot tomcat8085
            6:reboot tomcat8086
            7:reboot tomcat8087
            8:reboot tomcat8088
    EOF
    read -t 10 -p "Enter a mnumber : " number
    number=${number:-1}
    case $number in
        1)
            proId=`ps -ef | grep tomcat8081 | grep java | awk '{print $2}'`
            kill -9 $proId
            sleep 5
            cd /usr/tomcats/tomcat8081
            rm -rf logs/* work
            ./bin/startup.sh
            exit
            ;;
        2)
            proId=`ps -ef | grep tomcat8082 | grep java | awk '{print $2}'`
            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 $2}'`
            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 $2}'`
            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 $2}'`
            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 $2}'`
            kill -9 $proId
            sleep 5
            cd /usr/tomcats/tomcat8086
            rm -rf logs/* work
            ./bin/startup.sh
            exit
            ;;
        7)
            proId=`ps -ef | grep tomcat8087 | grep java | awk '{print $2}'`
            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 $2}'`
            kill -9 $proId
            sleep 5
            cd /usr/tomcats/tomcat8088
            rm -rf logs/* work
            ./bin/startup.sh
            exit
            ;;
        *)
            echo "please input 1-8"
    esac
  • 相关阅读:
    C++继承与派生的概念、什么是继承和派生
    为什么要用重载(学习笔记)
    C++ 为什么要用覆盖(学习笔记)
    做一个爱分享的人技术牛人博客
    okhttp head()请求
    android 8.0 前台服务问题
    android 配置 kotlin 使用jdk1.8编译
    java 获取apk包的版本号、包路径。权限信息
    vue 自定义input控件 v-model 绑定数据问题
    android ViewModel 列表数据获取条数
  • 原文地址:https://www.cnblogs.com/fansik/p/5611774.html
Copyright © 2020-2023  润新知