Files
sys_manager_ebtp_project/app.sh
刘倡 4ae4ee62ca 修改包名,统一成coscoshipping
添加了登录成功后存储cacheUser信息至redis
新增部署后启动脚本app.sh
2025-06-23 17:23:05 +08:00

60 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
APP_NAME="sys_manager_ebtp_project-0.0.1.jar"
APP_PORT=18030
LOG_FILE="app.log"
PID_FILE="app.pid"
start() {
if [ -f "$PID_FILE" ]; then
echo "应用已经在运行中PID: $(cat $PID_FILE)"
exit 1
fi
echo "正在启动应用..."
nohup java -jar $APP_NAME --spring.config.location=application-sim.yml > $LOG_FILE 2>&1 &
echo $! > $PID_FILE
echo "应用已启动PID: $(cat $PID_FILE)"
}
stop() {
if [ ! -f "$PID_FILE" ]; then
echo "应用未运行"
exit 1
fi
echo "正在停止应用PID: $(cat $PID_FILE)..."
kill -9 $(cat $PID_FILE)
rm -f $PID_FILE
echo "应用已停止"
}
status() {
if [ -f "$PID_FILE" ]; then
echo "应用正在运行PID: $(cat $PID_FILE)"
else
echo "应用未运行"
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "使用方法: $0 {start|stop|restart|status}"
exit 1
esac
exit 0