#!/bin/sh
SERVER=/home/java/server
cd $SERVER
case "$1" in
start)
nohup java -Xmx128m -jar server.jar > $SERVER/server.log 2>&1 &
echo $! > $SERVER/server.pid
;;
stop)
kill `cat $SERVER/server.pid`
rm -rf $SERVER/server.pid
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: run.sh {start|stop|restart}"
;;
esac
exit 0
Linux下启动和关闭JAR程序(转)
最新推荐文章于 2023-02-07 10:22:33 发布