Update setup.sh

This commit is contained in:
ilyastar9999
2025-12-02 19:01:25 +03:00
parent 94e8ce0047
commit 6ba3af787f

View File

@@ -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