#!/bin/bash
cd /data/openapi
tmp2=`ps -ef |grep old |awk '{print $2}'|xargs kill -9`
sleep 10;
apimps=`ps gaux | grep old |grep -v grep |awk '{print $2}'`
if [ "$apim" == "" ] || [ $apim -ge 0 ];then
tmp2=`ps -ef | grep old |awk '{print $2}'|xargs kill -9`
sleep 10;
echo "---> Start the openapi."
nohup java -jar old -0.0.2-SNAPSHOT.jar > nohup.out 2>&1 &
else
echo "---> Start the openapi ."
nohup java -jar old -0.0.2-SNAPSHOT.jar > nohup.out 2>&1 &
fi
标签:ps,grep,jar,sh,restart,print,old,模板,nohup
From: https://www.cnblogs.com/route/p/17482054.html