Created
July 2, 2025 17:38
-
-
Save phumpal/527670c72bb4c8a34852751d88aa7606 to your computer and use it in GitHub Desktop.
Check if HTTP is available on on Ubuntu apt repos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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