Created
September 8, 2017 16:52
-
-
Save hiroshiro/47ab686ab3457d86749b5e08d6b24617 to your computer and use it in GitHub Desktop.
One liner speed test by ping
This file contains hidden or 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
function lan_speed_one_liner | |
set -l host $argv[1] | |
set -l datasize $argv[2] | |
printf "password: " | |
read -l pass | |
echo $pass | sudo -S ping -c 10 -s $datasize $host | grep avg | cut -d\/ -f5 | awk '{print $1/1000}' | awk '{print 120000/$1}' | awk '{print $1*8/1024/1024"Mbps"}' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment