From d229ab5519078b482a508597546835f82ee03715 Mon Sep 17 00:00:00 2001 From: ilyastar9999 Date: Tue, 2 Dec 2025 20:24:10 +0300 Subject: [PATCH] Update setup.sh --- setuper/setup.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setuper/setup.sh b/setuper/setup.sh index 01b0061..f79f4cd 100644 --- a/setuper/setup.sh +++ b/setuper/setup.sh @@ -144,8 +144,6 @@ DCEOF docker compose up -d --no-build echo "Waiting for Packmate to be ready..." sleep 5 - echo "Registering Packmate with controller..." - call_api "/services" "POST" "{\"name\": \"packmate\", \"path\": \"$packmate_dir\", \"git_url\": \"https://gitlab.com/packmate/Packmate.git\"}" cd "$SCRIPT_DIR" } @@ -206,8 +204,6 @@ setup_firegex() { echo "Installing Firegex using official installer..." sh -c "$(curl -sLf https://pwnzer0tt1.it/firegex.sh)" - echo "Registering Firegex with controller..." - call_api "/services" "POST" "{\"name\": \"firegex\", \"path\": \"$firegex_dir\", \"git_url\": \"https://github.com/Pwnzer0tt1/firegex.git\"}" cd "$SCRIPT_DIR" } @@ -292,11 +288,15 @@ start_game_services() { local service_ports=$(grep -E '^\s*-\s*"?[0-9]+:[0-9]+' "$compose_file" | sed 's/.*"\?\([0-9]*\):[0-9]*.*/\1/' | tr '\n' ',' | sed 's/,$//') echo "Exposed ports for $service_name: $service_ports" - # Register service with controller and send ports - echo "Registering $service_name with controller..." - local ports_json="[$service_ports]" - ports_json=$(echo "$ports_json" | sed 's/,/,/g') - call_api "/services" "POST" "{\"name\": \"$service_name\", \"path\": \"$service_rel_path\", \"ports\": $ports_json}" + # Register service with controller and send ports, except for Firegex, farm, and packmate + if [[ "$service_name" != "firegex" && "$service_name" != "farm" && "$service_name" != "packmate" ]]; then + echo "Registering $service_name with controller..." + local ports_json="[$service_ports]" + ports_json=$(echo "$ports_json" | sed 's/,/,/g') + call_api "/services" "POST" "{\"name\": \"$service_name\", \"path\": \"$service_rel_path\", \"ports\": $ports_json}" + else + echo "Skipping controller registration for $service_name." + fi # Add service to Packmate if Packmate is running if [ -n "$service_ports" ]; then