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
标签:aaa,exc,示例,jar,echo,sh,linux,java,1.0 From: https://www.cnblogs.com/scode2/p/17573038.html