测试环境主机执行脚本

#!/bin/bash
echo $USER
workhome=/lvnktest/dygaelasticsearch-service/
workjar=${workhome}dygaelasticsearch-service.jar
pid=`ps -ef|grep dygaelasticsearch-service.jar|grep -v 'grep' | awk '{print $2}'`
if [ -z $pid ];
  then echo "dygaelasticsearch-service is not running, so just to start it..."
else
  echo "dygaelasticsearch-service[pid=${pid}] is running, so i should kill the progress and restart it... "
  kill -9 $pid
fi
nohup java -jar ${workjar} > ${workhome}spring.log &
exit

 

 

 

 

posted @ 2020-06-16 16:40  虞岩  阅读(169)  评论(0编辑  收藏  举报