Fix Vanguards wait loop to respect --control_ip arg
This commit is contained in:
parent
f87ec7af08
commit
13163d39f7
1 changed files with 14 additions and 3 deletions
|
|
@ -7,11 +7,22 @@ if [ "$1" = "vanguards" ]; then
|
||||||
echo "Starting Vanguards Sidecar Mode..."
|
echo "Starting Vanguards Sidecar Mode..."
|
||||||
shift # remove 'vanguards' from the arguments
|
shift # remove 'vanguards' from the arguments
|
||||||
|
|
||||||
# Extract the hostname from the arguments?
|
# Extract TARGET_HOST from arguments (looking for --control_ip)
|
||||||
# For now, we assume 'tor-service' as per the standard docker-compose setup
|
TARGET_HOST="tor-service" # Default fallback
|
||||||
TARGET_HOST="tor-service"
|
|
||||||
TARGET_PORT=9051
|
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..."
|
echo "Waiting for Tor Control Port at $TARGET_HOST:$TARGET_PORT..."
|
||||||
# Use Python to wait for the port (more reliable than Alpine's nc)
|
# Use Python to wait for the port (more reliable than Alpine's nc)
|
||||||
python3 -c "import socket, time;
|
python3 -c "import socket, time;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue