在jar包所在目录
vim start.sh | reload.sh | stop.sh
输入以下命令 然后保存,进行授权
1.启动
nohup java -jar -Dfile.encoding=utf-8 IntegrationFrame-sso-1.0.0-SNAPSHOT.jar &
echo "started"
2.重启
pid=$(ps -ef|grep IntegrationFrame-sso-1.0.0-SNAPSHOT | grep -v grep | awk '{print $2}')
echo "进程号:$pid"
if [ "$pid" != "" ]
then
echo "kill -9 $pid"
kill -9 $pid
fi
nohup java -jar -Dfile.encoding=utf-8 IntegrationFrame-sso-1.0.0-SNAPSHOT.jar &
echo "reloaded"
3.停止
pid=$(ps -ef|grep IntegrationFrame-sso-1.0.0-SNAPSHOT | grep -v grep | awk '{print $2}')
echo "进程号:$pid"
if [ "$pid" != "" ]
then
echo "kill -9 $pid"
kill -9 $pid
fi
echo "stoped"
4.授权
chmod +x start.sh|reload.sh|stop.sh