fix: modify the post-steps.sh
This commit is contained in:
@@ -1,29 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
|
||||||
#PORT=8889
|
|
||||||
#JAR_PATH="/home/zhangbiqiong/pro_eld_mqtt_compare/target/pro_eld_mqtt_compare-0.0.1-SNAPSHOT.jar"
|
|
||||||
#
|
|
||||||
## 检测端口是否被占用
|
|
||||||
#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" > /dev/null 2>&1 &
|
|
||||||
# echo "Application started with PID $!"
|
|
||||||
#fi
|
|
||||||
|
|
||||||
PORT=8889
|
PORT=8889
|
||||||
JAR_PATH="/home/zhangbiqiong/pro_eld_mqtt_compare/target/pro_eld_mqtt_compare-0.0.1-SNAPSHOT.jar"
|
JAR_PATH="/home/zhangbiqiong/pro_eld_mqtt_compare/target/pro_eld_mqtt_compare-0.0.1-SNAPSHOT.jar"
|
||||||
LOG_DIR="/home/zhangbiqiong/pro_eld_mqtt_compare/logs"
|
LOG_DIR="/home/zhangbiqiong/pro_eld_mqtt_compare/logs"
|
||||||
|
|
||||||
cd /home/zhangbiqiong/pro_eld_mqtt_compare || { echo "Failed to cd"; exit 1; }
|
# 检测端口是否被占用
|
||||||
|
|
||||||
if netstat -tuln | grep -q ":$PORT"; then
|
if netstat -tuln | grep -q ":$PORT"; then
|
||||||
echo "Port $PORT is already in use. Not starting application."
|
echo "Port $PORT is already in use. Not starting application."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Port $PORT is free. Starting application..."
|
echo "Port $PORT is free. Starting application..."
|
||||||
nohup java -DLOG_HOME="$LOG_DIR" -jar "$JAR_PATH" > "$LOG_DIR/nohup.out" 2>&1 &
|
nohup java -DLOG_HOME="$LOG_DIR" -jar "$JAR_PATH" > /dev/null 2>&1 &
|
||||||
echo "Application started with PID $!"
|
echo "Application started with PID $!"
|
||||||
fi
|
fi
|
Reference in New Issue
Block a user