Files
SOP/script/startup.sh
六如 e009576889 5.0
2024-12-23 15:24:43 +08:00

22 lines
487 B
Bash

#!/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}' | sed -n '1'p)
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 &