From 6ba3af787f31bbad466a1f2b63f5efd5f451f560 Mon Sep 17 00:00:00 2001 From: ilyastar9999 Date: Tue, 2 Dec 2025 19:01:25 +0300 Subject: [PATCH] Update setup.sh --- setuper/setup.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/setuper/setup.sh b/setuper/setup.sh index 31e73c9..69617a3 100644 --- a/setuper/setup.sh +++ b/setuper/setup.sh @@ -269,13 +269,14 @@ start_game_services() { echo "Adding $service_name to Packmate..." PACKMATE_URL="http://${PACKMATE_LOCAL_IP}:65000" # Try to add each port to Packmate - IFS=',' read -ra PORTS <<< "$service_ports" - for port in "${PORTS[@]}"; do - curl -s -X POST "${PACKMATE_URL}/api/service/" \ - -H "Accept: application/json" \ - -H "Authorization: Basic $PACKMATE_AUTH" \ - -H "Content-Type: application/json" \ - -d "{\"name\": \"$service_name\", \"port\": $port}" || true + echo "$service_ports" | tr ',' '\n' | while read port; do + if [ -n "$port" ]; then + curl -s -X POST "${PACKMATE_URL}/api/service/" \ + -H "Accept: application/json" \ + -H "Authorization: Basic $PACKMATE_AUTH" \ + -H "Content-Type: application/json" \ + -d "{\"name\": \"$service_name\", \"port\": $port}" || true + fi done fi