Update setup.sh
This commit is contained in:
@@ -144,8 +144,6 @@ DCEOF
|
|||||||
docker compose up -d --no-build
|
docker compose up -d --no-build
|
||||||
echo "Waiting for Packmate to be ready..."
|
echo "Waiting for Packmate to be ready..."
|
||||||
sleep 5
|
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"
|
cd "$SCRIPT_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,8 +204,6 @@ setup_firegex() {
|
|||||||
echo "Installing Firegex using official installer..."
|
echo "Installing Firegex using official installer..."
|
||||||
sh -c "$(curl -sLf https://pwnzer0tt1.it/firegex.sh)"
|
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"
|
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/,$//')
|
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"
|
echo "Exposed ports for $service_name: $service_ports"
|
||||||
|
|
||||||
# Register service with controller and send ports
|
# Register service with controller and send ports, except for Firegex, farm, and packmate
|
||||||
echo "Registering $service_name with controller..."
|
if [[ "$service_name" != "firegex" && "$service_name" != "farm" && "$service_name" != "packmate" ]]; then
|
||||||
local ports_json="[$service_ports]"
|
echo "Registering $service_name with controller..."
|
||||||
ports_json=$(echo "$ports_json" | sed 's/,/,/g')
|
local ports_json="[$service_ports]"
|
||||||
call_api "/services" "POST" "{\"name\": \"$service_name\", \"path\": \"$service_rel_path\", \"ports\": $ports_json}"
|
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
|
# Add service to Packmate if Packmate is running
|
||||||
if [ -n "$service_ports" ]; then
|
if [ -n "$service_ports" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user