linux java启动脚本示例
start.sh
#!/bin/bash
nohup /usr/jdk1.8.0_102/bin/java -jar -Xms400m -Xmn200m -Xmx500m -Dtwasp.config.uri=http://192.168.128.132:9300/configs -Deureka.client.serviceUrl.defaultZone=http://192.168.128.132:9100/eureka/ -Deureka.client.register-with-eureka=true /home/aaa-1.0.2-exc.jar > aaa.log 2>&1 &
stop.sh
#!/bin/bash
PID=$(ps -ef | grep aaa-1.0.2-exc.jar | grep -v grep | awk '{ print $2 }')
if [ -z "${PID}" ];
then
echo 'aaa-1.0.2-exc.jar is already stopped...'
else
echo 'aaa-1.0.2-exc.jar is stpping...'
echo kill $PID DONE
kill -9 $PID
fi
sh start.sh
sh stop.sh
编程PDF电子书免费下载: http://www.shitanlife.com/code 每天学习一点点