Created
October 29, 2014 20:58
-
-
Save dgmltn/792333d1c9e16f41aa25 to your computer and use it in GitHub Desktop.
Speed test shell script (using curl or wget)
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/sh | |
FILE_URL=http://speedtest.wdc01.softlayer.com/downloads/test10.zip | |
if [ -e /usr/bin/curl ] && [ -e /usr/bin/bc ] && [ -e /usr/bin/xargs ]; then | |
echo "scale=2; `curl --progress-bar -w "%{speed_download}" $FILE_URL -o /dev/null` / 131072"\ | |
| bc\ | |
| xargs -I {} echo {} mbps | |
elif [ -e /usr/bin/curl ]; then | |
curl -o /dev/null $FILE_URL | |
elif [ -e /usr/bin/wget ]; then | |
wget --output-document=/dev/null $FILE_URL | |
else | |
echo "Neither wget nor curl commands found" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment