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