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)