zoukankan      html  css  js  c++  java
  • linux_java_同时启动三个项目脚本

    test.sh

    --------------------------------------------------------------------------------------------------------------------------------------

    #!/bin/sh
    while :
    do
    run1=$(ps -ef |grep 'sxnx-sms-8081' |grep -v "grep")
    run2=$(ps -ef |grep 'sxnx-sms-8082' |grep -v "grep")
    run3=$(ps -ef |grep 'sxnx-sms-8083' |grep -v "grep")
    if [ "$run1" ] ; then
    echo "The sxnx-sms-8081 service is alive!"
    else
    echo "The sxnx-sms service was shutdown!"
    echo "Starting service sxnx-sms-8081..."
    nohup java -jar $PWD/sxnx-sms-8081.jar&
    echo "The service sxnx-sms-8081 was started!"
    fi
    if [ "$run2" ] ; then
    echo "The sxnx-sms-8082 service is alive!"
    else
    echo "The sxnx-sms service was shutdown!"
    echo "Starting service sxnx-sms-8082..."
    nohup java -jar $PWD/sxnx-sms-8082.jar&
    echo "The service sxnx-sms-8082 was started!"
    fi
    if [ "$run3" ] ; then
    echo "The sxnx-sms-8083 service is alive!"
    else
    echo "The sxnx-sms service was shutdown!"
    echo "Starting service sxnx-sms-8083..."
    nohup java -jar $PWD/sxnx-sms-8083.jar&
    echo "The service sxnx-sms-8083 was started!"
    fi
    sleep 10
    done

    =======================================================================================================================

    去掉while循环,只执行一次

    #!/bin/sh
    run1=$(ps -ef |grep 'sxnx-sms-8081' |grep -v "grep")
    run2=$(ps -ef |grep 'sxnx-sms-8082' |grep -v "grep")
    run3=$(ps -ef |grep 'sxnx-sms-8083' |grep -v "grep")
    if [ "$run1" ] ; then
    echo "The sxnx-sms-8081 service is alive!"
    else
    echo "The sxnx-sms service was shutdown!"
    echo "Starting service sxnx-sms-8081..."
    nohup java -jar $PWD/sxnx-sms-8081.jar&
    echo "The service sxnx-sms-8081 was started!"
    fi
    if [ "$run2" ] ; then
    echo "The sxnx-sms-8082 service is alive!"
    else
    echo "The sxnx-sms service was shutdown!"
    echo "Starting service sxnx-sms-8082..."
    nohup java -jar $PWD/sxnx-sms-8082.jar&
    echo "The service sxnx-sms-8082 was started!"
    fi
    if [ "$run3" ] ; then
    echo "The sxnx-sms-8083 service is alive!"
    else
    echo "The sxnx-sms service was shutdown!"
    echo "Starting service sxnx-sms-8083..."
    nohup java -jar $PWD/sxnx-sms-8083.jar&
    echo "The service sxnx-sms-8083 was started!"
    fi


  • 相关阅读:
    金融资产的票面利率与实际利率
    对于确定承诺的外汇风险,既属于公允价值套期,又属于现金流量套期,怎么区分呢?
    套期工具(公允价值套期与现金流量套期)
    R语言使用 LOWESS技术图分析逻辑回归中的函数形式
    R语言ROC曲线下的面积
    R语言Poisson回归的拟合优度检验
    R语言在逻辑回归中求R square R方
    R平方/相关性取决于预测变量的方差
    stata具有异方差误差的区间回归
    R语言用于线性回归的稳健方差估计
  • 原文地址:https://www.cnblogs.com/curedfisher/p/13039872.html
Copyright © 2011-2022 走看看