Created
June 19, 2017 09:17
-
-
Save barkink/1dcfdd9d1e8ba0a3531217c3760238b8 to your computer and use it in GitHub Desktop.
Throughout.sh
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
#!/bin/bash | |
intervalo=1 | |
info="/sys/class/net/" | |
cd $info | |
for interface in eth* | |
do | |
rx1=`cat $info$interface/statistics/rx_bytes` | |
tx1=`cat $info$interface/statistics/tx_bytes` | |
`sleep $((intervalo))s` | |
rx2=`cat $info$interface/statistics/rx_bytes` | |
tx2=`cat $info$interface/statistics/tx_bytes` | |
echo -n $interface | |
echo -n " ---- " | |
echo -n RX: $((($rx2-$rx1)/($intervalo*1024))) Kbps | |
echo -n TX: $((($tx2-$tx1)/($intervalo*1024))) Kbps \n | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment