diff --git a/packetloss b/packetloss index c139fcc..1173e99 100755 --- a/packetloss +++ b/packetloss @@ -5,7 +5,7 @@ declare -a servers=('1.1.1.1' '8.8.8.8') declare -i highestloss=0 declare -i alltimehighest=0 -declare -i alltimelowest=0 +declare -i alltimelowest=100 declare -i iterations=1 while :; do @@ -23,6 +23,12 @@ while :; do if (( highestloss > 0 )); then color="\e[31m" fi + if (( highestloss > alltimehighest )); then + alltimehighest="$highestloss" + fi + if (( highestloss < alltimelowest )); then + alltimelowest="$highestloss" + fi printf "\\rCurrent loss: $color%-3.3s\e[0m - \e[33m%-4.4s \e[34m%-4.4s \e[0m%-4.4s" \ "$highestloss" \ "$alltimehighest" \