Skip to content

Instantly share code, notes, and snippets.

@koter84
Last active June 30, 2022 05:30
Show Gist options
  • Save koter84/3e529e2e4876329cf44de36166952601 to your computer and use it in GitHub Desktop.
Save koter84/3e529e2e4876329cf44de36166952601 to your computer and use it in GitHub Desktop.
do a simple speedtest from commandline
#!/bin/bash
links=(
"http://mirror.nl.leaseweb.net/speedtest/1000mb.bin"
"http://download.xs4all.nl/test/1GB.bin"
"http://ftp.snt.utwente.nl/pub/test/1000M"
"http://www.colocenter.nl/speedtest/1000mb.bin"
"http://speed.transip.nl/1000mb.bin"
"http://mirror.widexs.nl/ftp/pub/speed/1000mb.bin"
"http://mirror.nforce.com/pub/speedtests/1000mb.bin"
"https://speedtest2.mnd.bulk.iss.as9143.net:8888/download?size=1048576000"
)
if [ "$(which curl)" != "" ]
then
downloader="curl -4 -o /dev/null"
elif [ "$(which wget)" != "" ]
then
downloader="wget -4 -O /dev/null --quiet --show-progress"
else
echo "commands 'curl' and/or 'wget' not found"
exit
fi
for link in ${links[@]}
do
echo "> $link"
echo -n "run this download ? [Y/n] "
read run_this
if [ "$run_this" != "N" ] && [ "$run_this" != "n" ]
then
#echo "timeout 30s $downloader $link >/dev/null"
timeout 30s $downloader $link >/dev/null ; echo
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment