Skip to content

Instantly share code, notes, and snippets.

@grahamcrowell
Created October 16, 2017 03:21
Show Gist options
  • Save grahamcrowell/3c8157c0151dbd6942c9cca24798c55a to your computer and use it in GitHub Desktop.
Save grahamcrowell/3c8157c0151dbd6942c9cca24798c55a to your computer and use it in GitHub Desktop.
shell internet speed test
# script=speedtest.sh && touch $script && sudo chmod 777 $script && vi $script && printf "running: %s\n" $script && ./$script
echo "***********************"
echo "internet speed test..."
echo "***********************"
printf "\n===================================\n"
printf "installing... speedtest-cli\n"
printf "===================================\n"
speedtest-cli --version
# brew install speedtest-cli
# sudo apt install speedtest-cli
printf "===================================\n\n"
hostname="HOME-mac"
hostname="HOME-linux"
printf "\n===================================\n"
printf "starting internet speed test . . . (~30 seconds)\n"
out="net_speed-"$hostname"-"
out=$out$(date -u +"%Y-%m-%dT%H:%M")".log"
printf "logging to: '%s'\n" $out
printf "===================================\n"
speedtest-cli | tee $out
printf "===================================\n\n"
printf "\n***********************\n"
printf "test complete. see log at:\n%s/%s\n" $PWD $out
printf "***********************\n\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment