Created
March 12, 2017 20:24
-
-
Save mg6/7321d66ac93d9550322afd8aeec2789a to your computer and use it in GitHub Desktop.
DigitalOcean datacenter ping
This file contains 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 | |
export LC_ALL=C | |
curl -s "http://speedtest-ams2.digitalocean.com/" \ | |
| grep -Eo "speedtest\-.+.digitalocean.com" \ | |
| while read -r addr; do | |
echo -n "$addr " | |
ping -c5 -w3 "$addr" | tail -1 | awk -F / -- '{print $5, $0}' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment