This commit is contained in:
六如
2024-12-23 11:45:47 +08:00
parent 3f7bb181fa
commit 12479cffd2
8 changed files with 41 additions and 2 deletions

21
script/startup.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/sh
# 执行文件名称
app_name=${1}
if [ -z "${1}" ];then
echo "未指定应用程序参数,格式:sh startup.sh xxx.jar"
exit 0
fi
echo "启动程序:${app_name}"
# 先关闭服务
pid=$(ps -ef | grep $app_name | grep -v grep | awk '{print $2}')
if [ -n "$pid" ]; then
echo "stop $app_name, pid:$pid"
kill -9 "$pid"
fi
nohup java -server -jar -Dspring.profiles.active=test -Duser.timezone=Asia/Shanghai -Xms512m -Xmx512m $app_name >/dev/null 2>&1 &