init full backend repo with src + deploy config
This commit is contained in:
15
bin/post-steps.sh
Executable file
15
bin/post-steps.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
PORT=8888
|
||||
JAR_PATH="/home/alex/alex-api/app/alex-api-0.0.1-SNAPSHOT.jar"
|
||||
LOG_PATH="/home/alex/alex-api/logs/alex-api.log"
|
||||
|
||||
# 检测端口是否被占用
|
||||
if netstat -tuln | grep -q ":$PORT"; then
|
||||
echo "Port $PORT is already in use. Not starting application."
|
||||
exit 0
|
||||
else
|
||||
echo "Port $PORT is free. Starting application..."
|
||||
nohup java -jar "$JAR_PATH" > "$LOG_PATH" 2>&1 &
|
||||
echo "Application started with PID $!"
|
||||
fi
|
Reference in New Issue
Block a user