文件名:xxx.sh
count = `ps -ef | grep -e /opt/01boot/xxx.jar |grep -v grep| wc -1`
echo $count
if [ $count != 0 ]
then
ps -ef |grep -s /opt/01boot/xxx.jar |grep -v grep|awk '{print $2}' |xargs kill -9
fi
echo "=====应用停止成功=====“
echo "=====启动应用成功=====”
sleep 1
nohup java -jar -Xss`1m -Xms1024m -Xmx1024 -Dencoding=UTF-8 -Dfile.encoding=UTF-8 -Dspring.profiles.active=dev /opt/01boot/xxx.jar > /opt/01boot/logs/xxx.log 2>&1 &
tail -f ../logs/xxx.log```