Skip to content

Instantly share code, notes, and snippets.

@mg6
Created March 12, 2017 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mg6/7321d66ac93d9550322afd8aeec2789a to your computer and use it in GitHub Desktop.
Save mg6/7321d66ac93d9550322afd8aeec2789a to your computer and use it in GitHub Desktop.
DigitalOcean datacenter ping
#!/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