springboot项目部署之停止关闭项目脚本shutdown.sh

使用vim编辑器编辑

vim shutdown.sh

内容如下

#!/bin/bash
  
if [ ! -n "$1" ]; then
    echo Please Enter jar file name
    exit
fi

NAME=$1

echo $NAME

nohup  /usr/local/java/bin/java -jar  -Xms512m -Xmx512m -jar "$NAME" --spring.config.location=file:app.properties > logs/start.log 2>&1 &

ID=`ps -ef | grep "$NAME" | grep -v "$0" | grep -v "grep" | awk '{print $2}'`

echo "start $ID"

执行语句

./shutdown.sh  xxx.jar

相关内容相关内容

springboot 项目部署之启动服务脚本start.shspringboot 项目部署之启动服务脚本start.sh

相关文章:

  • 2022-12-23
  • 2022-01-26
  • 2021-04-23
  • 2021-11-27
  • 2021-09-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-08-27
  • 2021-05-28
  • 2021-07-14
相关资源
相似解决方案