Skip to content

Instantly share code, notes, and snippets.

@phumpal
Created July 2, 2025 17:38
Show Gist options
  • Save phumpal/527670c72bb4c8a34852751d88aa7606 to your computer and use it in GitHub Desktop.
Save phumpal/527670c72bb4c8a34852751d88aa7606 to your computer and use it in GitHub Desktop.
Check if HTTP is available on on Ubuntu apt repos
#!/bin/bash
IPs=(
185.125.190.82
91.189.91.83
)
PORT=80
TIMEOUT=5
for IP in "${IPs[@]}"; do
echo "Trying $IP on port $PORT..."
until nc -z -v -w$TIMEOUT $IP $PORT; do
echo "Waiting for $IP:$PORT to become available..."
sleep 2
done
echo "$IP:$PORT is reachable!"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment