Skip to content

Instantly share code, notes, and snippets.

@brunsgaard
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brunsgaard/ca304fc308a085b3a6cb to your computer and use it in GitHub Desktop.
Save brunsgaard/ca304fc308a085b3a6cb to your computer and use it in GitHub Desktop.
datanet test debian mirrors
#!/bin/bash
hosts=(
ftp.dk.debian.org
ftp.cn.debian.org
)
for host in ${hosts[@]}; do
IP=`nslookup $host | sed 's/Address: //' | tail -n 2 | head -n 1`
echo ==== TESTING $IP \($host\) ====
echo Ping: `ping -c 64 $IP | grep rtt`
echo Wget: `wget -O /dev/null $IP/debian/dists/stable/Contents-amd64.gz 2>&1 | grep 'saved' | sed 's/.*(//' | sed 's/).*//'`
traceroute $IP | sed 's/traceroute.*/Traceroute:/'
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment