Created
February 3, 2016 05:41
-
-
Save fortitudepub/9ce92e8dbb62af916a7a to your computer and use it in GitHub Desktop.
calc if rx stats by shell script.
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
ifname=$1 | |
let bytes1=0 | |
while true; do | |
let bytes2=`ip -s link show $ifname | grep -A 1 RX | grep -v RX | awk '{print $1}'` | |
let diff=(bytes2 - bytes1) | |
let diff=(diff / 1024 / 1024) | |
echo "bandwitdth is $diff Mbps" | |
let bytes1=bytes2 | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment