summaryrefslogtreecommitdiffstats
path: root/analyze.sh
diff options
context:
space:
mode:
Diffstat (limited to 'analyze.sh')
-rwxr-xr-xanalyze.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/analyze.sh b/analyze.sh
index 9c11bd6..33799cc 100755
--- a/analyze.sh
+++ b/analyze.sh
@@ -2,9 +2,11 @@
sleep=1
-stats1=($(ethtool -S ens11 | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }'))
+int=$(ip addr show | grep "192\.168\.2\." | awk '{ print $NF }')
+
+stats1=($(ethtool -S $int | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }'))
sleep $sleep
-stats2=($(ethtool -S ens11 | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }'))
+stats2=($(ethtool -S $int | grep -P "rx\d?_(packets|bytes)" | awk '{ print $2 }'))
for i in "${!stats1[@]}"; do
diff=$(bc <<< "(${stats2[$i]} - ${stats1[$i]}) / $sleep")