Fix a bunch of bugs with the incomplete impl of packetloss
This commit is contained in:
		| @@ -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" \ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user