diff options
author | rafa_99 <raroma09@gmail.com> | 2021-08-22 23:06:30 +0100 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2021-08-22 23:06:30 +0100 |
commit | 319f4645669647bd30d1bd3c2aa74e063a4b5e59 (patch) | |
tree | cb66c8c07283814d6ad826d38ae72427eefad05b /scripts/.local | |
parent | 0aa842d9a71a9d3d6480ac23b3c8f8761cee7a56 (diff) |
Added Bandwidth tester script
Diffstat (limited to 'scripts/.local')
-rwxr-xr-x | scripts/.local/bin/bandwidth | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/.local/bin/bandwidth b/scripts/.local/bin/bandwidth new file mode 100755 index 0000000..0b83631 --- /dev/null +++ b/scripts/.local/bin/bandwidth @@ -0,0 +1,12 @@ +#!/bin/sh + + +init="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '*')))" + +printf "Recording bandwidth. Press enter to stop." + +read -r + +ending="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '+')))" + +printf "%4sB of bandwidth used. \\n" "$(numfmt --to=iec $((ending-init)))" |