mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-16 02:49:10 +01:00
Update check-ping.ps1
This commit is contained in:
parent
7f31a3b98b
commit
aa7ae2fff1
@ -7,7 +7,7 @@
|
|||||||
PS> ./check-network.ps1
|
PS> ./check-network.ps1
|
||||||
|
|
||||||
N E T W O R K
|
N E T W O R K
|
||||||
✅ Firewall enabled
|
✅ Online with 30ms latency (16ms..56ms, 0/10 loss)
|
||||||
...
|
...
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
" "
|
" "
|
||||||
& "$PSScriptRoot/write-green.ps1" " N E T W O R K"
|
& "$PSScriptRoot/write-green.ps1" " N E T W O R K"
|
||||||
& "$PSScriptRoot/check-firewall"
|
|
||||||
& "$PSScriptRoot/check-ping.ps1"
|
& "$PSScriptRoot/check-ping.ps1"
|
||||||
|
& "$PSScriptRoot/check-firewall"
|
||||||
& "$PSScriptRoot/check-dns.ps1"
|
& "$PSScriptRoot/check-dns.ps1"
|
||||||
& "$PSScriptRoot/check-vpn.ps1"
|
& "$PSScriptRoot/check-vpn.ps1"
|
||||||
& "$PSScriptRoot/list-public-ip.ps1"
|
& "$PSScriptRoot/list-public-ip.ps1"
|
||||||
|
@ -36,11 +36,11 @@ try {
|
|||||||
$lossCount++
|
$lossCount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($successCount -eq 0) {
|
if ($successCount -ne 0) {
|
||||||
Write-Host "⚠️ Offline ($lossCount/$totalCount loss)"
|
|
||||||
} else {
|
|
||||||
$avg /= $successCount
|
$avg /= $successCount
|
||||||
Write-Host "✅ Ping latency is $($avg)ms average ($($min)ms...$($max)ms, $lossCount/$totalCount loss)"
|
Write-Host "✅ Online with $($avg)ms ping latency ($($min)ms...$($max)ms, $lossCount/$totalCount loss)"
|
||||||
|
} else {
|
||||||
|
Write-Host "⚠️ Offline ($lossCount/$totalCount loss)"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user