Fix math for suri loss calulcations

This commit is contained in:
Mike Reeves
2020-06-25 14:02:02 -04:00
parent 1e6fab4e6e
commit 1e4c967afc

View File

@@ -15,7 +15,9 @@ if [ $CHECKIT == 2 ]; then
else
CURRENTPACKETS=${RESULT[9]}
PASTPACKETS=${RESULT[19]}
TOTAL=$(($CURRENTPACKETS - $PASTPACKETS + $DROPPED))
TOTALCURRENT=$(($CURRENTPACKETS + $CURRENTDROP))
TOTALPAST=$(($PASTPACKETS + $PASTDROP))
TOTAL=$(($TOTALCURRENT - $TOTALPAST))
LOSS=$(echo $DROPPED $TOTAL / p | dc)
echo "suridrop drop=$LOSS"