Fix issue with port number anomaly when the port string contains "6969" after restarting the container. #4

This commit is contained in:
AirryCo
2024-12-03 13:28:02 +08:00
parent 1ee6e90501
commit 11e497b78f

View File

@@ -30,8 +30,15 @@ else
PORT=$backendPort
fi
if [ -z "$webSocketPingDelayMs" ]; then
PINGDELAYMS=90000
else
PINGDELAYMS=$webSocketPingDelayMs
fi
sed -i "0,/127.0.0.1/s/127.0.0.1/${IP}/" SPT_Data/Server/configs/http.json
sed -i "s/6969/${PORT}/g" SPT_Data/Server/configs/http.json
sed -i "s/[0-9]\{1,\},/${PORT},/g" SPT_Data/Server/configs/http.json
tac SPT_Data/Server/configs/http.json | sed "0,/${PORT},/s/${PORT},/$webSocketPingDelayMs,/" | tac | tee SPT_Data/Server/configs/http.json > /dev/null
chmod +x SPT.Server && ./SPT.Server