From 13163d39f730d03ad878b9e926c5089fd36db360 Mon Sep 17 00:00:00 2001 From: wander Date: Sat, 7 Feb 2026 00:37:13 -0500 Subject: [PATCH] Fix Vanguards wait loop to respect --control_ip arg --- assets/entrypoint.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/assets/entrypoint.sh b/assets/entrypoint.sh index a8c41e0..aafd57e 100755 --- a/assets/entrypoint.sh +++ b/assets/entrypoint.sh @@ -7,10 +7,21 @@ if [ "$1" = "vanguards" ]; then echo "Starting Vanguards Sidecar Mode..." shift # remove 'vanguards' from the arguments - # Extract the hostname from the arguments? - # For now, we assume 'tor-service' as per the standard docker-compose setup - TARGET_HOST="tor-service" + # Extract TARGET_HOST from arguments (looking for --control_ip) + TARGET_HOST="tor-service" # Default fallback TARGET_PORT=9051 + + # Simple argument parsing to find control_ip + next_is_ip=0 + for arg in "$@"; do + if [ "$next_is_ip" -eq 1 ]; then + TARGET_HOST="$arg" + next_is_ip=0 + fi + if [ "$arg" = "--control_ip" ]; then + next_is_ip=1 + fi + done echo "Waiting for Tor Control Port at $TARGET_HOST:$TARGET_PORT..." # Use Python to wait for the port (more reliable than Alpine's nc)