批量处理linux java -jar jar服务模块脚本

4 篇文章 0 订阅
#!/bin/sh

#comments batch run po server 


config_nohup='nohup java -jar ';

config_command='command 1>'; 

config_and='86400 & ';

 

alert_1='一键启动PO-SERVER基础服务设施';


function configServer(){ #加载批量基础服务

  cd /;

  cd home/witts-java/Desktop/package/192.168.0.124/;

  ${config_nohup} guadan2.0-9304.jar command 1>guadan2.0.output 2>guadan.error 86400 &

  if [ $? -eq 0 ]; then

    echo "挂单模块执行成功";

  else

    echo "挂单模块执行失败";

  fi


  ${config_nohup} order2.0-9311.jar  command 1>order2.0.output 2>order2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "订单模块执行成功";

  else

    echo "订单模块执行失败";

  fi 


  ${config_nohup} project2.0-9302.jar command 1>project2.0.output 2>project2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "项目模块执行成功";

  else

    echo "项目模块执行失败";

  fi


  ${config_nohup} reports2.0-9305.jar command 1>reports2.0.output 2>reports2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "报表模块执行成功";

  else

    echo "报表模块执行失败";

  fi


  ${config_nohup} share2.0-9303.jar command 1>share2.0.output 2>share2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "分享模块执行成功";

  else

    echo "分享模块执行失败";

  fi


  ${config_nohup} shop2.0-9306.jar command 1>shop2.0.output 2>shop2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "店铺模块执行成功";

  else

    echo "店铺模块执行失败";

  fi


  ${config_nohup} spend2.0-9307.jar command 1>spend2.0.output 2>spend2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "开支模块执行成功";

  else

    echo "开支模块执行失败";

  fi


  ${config_nohup} storage2.0-9308.jar command 1>storage2.0.output 2>storage2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "库存模块执行成功";

  else

    echo "库存模块执行失败";

  fi


  ${config_nohup} system2.0-9301.jar command 1>system2.0.output 2>system2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "系统模块执行成功";

  else

    echo "系统模块执行失败";

  fi


  ${config_nohup} table2.0-9312.jar command 1>table2.0.output 2>table2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "台桌模块执行成功";

  else

    echo "台桌模块执行失败";

  fi


  ${config_nohup} ubs2.0-9309.jar command 1>ubs2.0.output 2>ubs2.error 86400 &

  if [ $? -eq 0 ]; then

    echo "师徒系统模块执行成功";

  else

    echo "师徒系统模块执行失败";

  fi

} 




echo $alert_1;


protData=$(ps -x|grep java|grep -v grep|awk '{print $1}');

 

echo "!!!杀死端口参数信息 "$protData"!!!";


kill -s 9 $protData;


###################################################################

if [ $? -eq 0 ]; then

  echo "********************杀死进程成功!开始启动服务********************"; 

  excuteRet1=$(configServer $1); 

  echo $excuteRet1;

  echo "1号调用返回状态"$?;

  if [ $? -eq 0 ]; then

  echo "1号重启服务成功啦";

  fi


else 

  echo "********************杀死进程失败!直接启动服务********************";    

  excuteRet2=$(configServer $1); 

  echo $excuteRet2;

  echo "2号调用返回状态"$?;

  if [ $? -eq 0 ]; then

  echo "2号重启服务成功啦";

  fi	


fi

###################################################################

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值