summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-07-10 18:47:53 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-07-10 18:47:53 +0200
commit627e01597b58dde17ececdeb178b3eb9925a58c7 (patch)
tree97ef6afc7132268f72a13ac651cf5e4e95aa8be2
parentd27b37c68725bf9a11a027e801d539cd471ffacd (diff)
downloadbin-627e01597b58dde17ececdeb178b3eb9925a58c7.tar.gz
bin-627e01597b58dde17ececdeb178b3eb9925a58c7.tar.xz
Add speedtest-ssh
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xspeedtest-ssh17
1 files changed, 17 insertions, 0 deletions
diff --git a/speedtest-ssh b/speedtest-ssh
new file mode 100755
index 0000000..9c63d3c
--- /dev/null
+++ b/speedtest-ssh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+host=$1
+mode=$2
+
+case "$mode" in
+ down)
+ ssh -S none "$host" -o Compression=no "cat /dev/zero" | pv >/dev/null
+ ;;
+ up)
+ pv </dev/zero | ssh -S none "$host" -o Compression=no "cat >/dev/null"
+ ;;
+*)
+ echo "usage: ${0##*/} <host> <up/down>" >&2
+ exit 1
+ ;;
+esac