Created
January 10, 2021 12:13
-
-
Save mrkane27/bdb59362f097ec578b6324f915e68163 to your computer and use it in GitHub Desktop.
Network speed test to a computer you have ssh access to
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
#!/usr/bin/env bash | |
if [ -z "$1" ]; then | |
echo "$0 <ssh args e.g. host>" | |
exit | |
fi | |
FN="/tmp/$(uuidgen)" | |
TESTSIZE=314572800 | |
echo generate | |
cat /dev/urandom | head -c $TESTSIZE > $FN | |
md5sum $FN | |
echo upload | |
cat $FN | pv -pabt | ssh $1 "tee $FN | md5sum" | |
echo | |
echo download | |
ssh $1 "cat $FN" | pv -pabt | md5sum | |
ssh $1 "rm $FN" | |
rm $FN | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment