测试环境主机执行脚本

HappinessCat 2020-06-16

#!/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

测试环境主机执行脚本

相关推荐

Linuxer / 0评论 2016-08-10