Fix Vanguards wait loop to respect --control_ip arg

This commit is contained in:
wander 2026-02-07 00:37:13 -05:00
parent f87ec7af08
commit 13163d39f7

View file

@ -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)