summaryrefslogtreecommitdiff
path: root/scripts/.local
diff options
context:
space:
mode:
authorrafa_99 <raroma09@gmail.com>2021-08-22 23:06:30 +0100
committerrafa_99 <raroma09@gmail.com>2021-08-22 23:06:30 +0100
commit319f4645669647bd30d1bd3c2aa74e063a4b5e59 (patch)
treecb66c8c07283814d6ad826d38ae72427eefad05b /scripts/.local
parent0aa842d9a71a9d3d6480ac23b3c8f8761cee7a56 (diff)
Added Bandwidth tester script
Diffstat (limited to 'scripts/.local')
-rwxr-xr-xscripts/.local/bin/bandwidth12
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)))"