#!/bin/bash
#
DataPid=`ps -ef |grep data2 |grep -v grep |awk '{print $2}'`
#JAVA_HOME=/opt/apps_install/jdk1.8.0_172
#PATH=$PATH:$JAVAHOME/bin
export PATH
start(){
Pro_Item=`ps -ef |grep history |grep -v grep |wc -l`
if [ ${Pro_Item} -ge 1 ];then
echo "history has been started"
else
java -Xms521m -Xmx1024m -jar ../lib/*.jar --spring.profiles.active=prod >> ../logs/data.log &
sleep 1
echo "history started ------------------- succeed"
fi
}
stop(){
Pro_Item=`ps -ef |grep history |grep -v grep |wc -l`
if [ ${Pro_Item} -ge 1 ];then
kill -9 ${DataPid}
sleep 1
echo "history stopping -------------------- succeed"
else
echo "history has been stoped"
fi
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo printf 'Usage: %s {start|stop|restart}\n' "$prog"
exit 7
;;
esac
springboot 运行脚本
admin / 开发 / ... / Reads: 1121
www.ultrapower.com ,王硕的博客,专注于研究互联网产品和技术,提供中文精品教程。
本网站与其它任何公司及/或商标无任何形式关联或合作。