From 1bb6efbc76948ee1338106c59e3a85f61d4356a6 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 24 Oct 2024 17:00:11 +0200 Subject: [PATCH] Improved ping-internet.ps1 --- scripts/ping-internet.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ping-internet.ps1 b/scripts/ping-internet.ps1 index 5defe5bc..9d48069f 100755 --- a/scripts/ping-internet.ps1 +++ b/scripts/ping-internet.ps1 @@ -39,7 +39,12 @@ try { Write-Host "✅ Online with $loss/$total ping loss and $($min)...$($max)ms latency - $($speed)ms average" } else { [float]$speed = [math]::round([float]$avg / [float]$success, 1) - Write-Host "✅ Internet ping takes $($speed)ms ($($min)...$($max)ms range)" + if ($speed -lt 20.0) { $result = "excellent" + } elseif ($speed -lt 50.0) { $result = "good" + } elseif ($speed -lt 100.0) { $result = "average" + } elseif ($speed -lt 150.0) { $result = "okay" + } else { $result = "laggy" } + Write-Host "✅ Internet ping is $($result): $($speed)ms ($($min)-$($max)ms range)" } exit 0 # success } catch {