fix: count int MiB

This commit is contained in:
David JULIEN 2021-03-16 00:19:00 +01:00
parent 316cbaae09
commit 6e2cf9214e

View File

@ -19,8 +19,8 @@ cntud="$(echo "$out" | grep -e "Up & Down" | wc -l)"
cntd="$(expr $ctnd + $cntud)"
cntu="$(expr $cntu + $cntud)"
infos="$(echo "$out"| tail -n1)"
spdd="$(echo "$infos" | awk -F " " '{ printf "%.2f", $5/1000 }')"
spdu="$(echo "$infos" | awk -F " " '{ printf "%.2f", $4/1000 }')"
spdd="$(echo "$infos" | awk -F " " '{ printf "%.2f", $5/1024 }')"
spdu="$(echo "$infos" | awk -F " " '{ printf "%.2f", $4/1024 }')"
[ 0 -ne $cntd ] && down="$(printf "%s(%sM)" "$cntd" "$spdd")" || down="---"
[ 0 -ne $cntu ] && up="$(printf "%s(%sM)" "$cntu" "$spdu")" || up="---"