Update setup.sh
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user