linux中jar包启动sh命令模板

#!/bin/sh
cd /usr/xxx/xxx/xxx/
pid=`ps -ef|grep 'xxxx.jar*'|grep -v grep|awk '{print $2}'`
if [ -n "${pid}" ];then
    kill -9 ${pid}
    echo "Process[WS] killed!"
    nohup java -jar xxxx.jar >group.out 2>&1 &
    echo "ReStart[WS] Success!"
        tail -100f /usr/local/xxx/xxx/group.out 
else
  nohup java
-jar xxx.jar >group.out 2>&1 &
  echo
"Start[WS] Success!"
  tail
-100f /usr/local/xxx/xxx/group.out
fi

 

posted @ 2022-08-24 11:29  LZ1024  阅读(239)  评论(0编辑  收藏  举报