Created
February 24, 2014 05:19
-
-
Save AndyObtiva/9182347 to your computer and use it in GitHub Desktop.
Speedtest Command for Bash. Assumes you have https://pypi.python.org/pypi/speedtest-cli installed.
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 | |
echo "Usage: speedtest [city]" | |
echo "Default city: Montreal" | |
echo "Examples:" | |
echo "$ speedtest Chicago" | |
echo "$ speedtest 'New York'\n" | |
[[ $1 ]] && city="$1" || city='Montreal' | |
echo "Speedtesting $city... Please be patient as this may take a minute or more depending on the Internet connection..." | |
speedtest-cli --list | grep -i "$city" | sed 's/^\([^\)]*\).*$/\1/' | sed -n '1,1p' | xargs speedtest-cli --share --server | grep 'Share results:' | grep 'Share results:' | sed 's/^Share results: \(.*\)$/\1/' | xargs open | |
echo "Done. If no report image has been opened, then please try again with another city." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment