Files
pro_eld_mqtt_compare/bin/post-steps.sh

14 lines
418 B
Bash
Raw Normal View History

2025-07-18 10:02:28 +08:00
#!/bin/bash
PORT=8889
2025-07-18 02:41:20 +00:00
JAR_PATH="/home/zhangbiqiong/pro_eld_mqtt_compare/target/pro_eld_mqtt_compare-0.0.1-SNAPSHOT.jar"
2025-07-18 10:02:28 +08:00
# 检测端口是否被占用
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..."
2025-08-06 09:58:05 +08:00
nohup java -jar "$JAR_PATH" > /dev/null 2>&1 &
2025-07-18 10:02:28 +08:00
echo "Application started with PID $!"
2025-07-18 10:50:57 +08:00
fi