11 lines
300 B
Plaintext
11 lines
300 B
Plaintext
|
#!/bin/sh
|
||
|
init="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '+')))"
|
||
|
|
||
|
printf "Recording bandwidth. Press enter to stop."
|
||
|
|
||
|
read -r wait
|
||
|
|
||
|
fin="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '+')))"
|
||
|
|
||
|
printf "%4sB of bandwidth used.\\n" $(numfmt --to=iec $(($fin-$init)))
|