From cd3ad88b655d983a896387b59cee3833efeefe6e Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 4 Nov 2024 20:34:49 +0100 Subject: [PATCH] Updated ping-host.ps1 and enter-host.ps1 --- scripts/enter-host.ps1 | 5 ++++- scripts/ping-host.ps1 | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/enter-host.ps1 b/scripts/enter-host.ps1 index 4c6a7e26..0d308458 100755 --- a/scripts/enter-host.ps1 +++ b/scripts/enter-host.ps1 @@ -31,7 +31,10 @@ try { } & "$PSScriptRoot/ping-host.ps1" $remoteHost - if ($lastExitCode -ne "0") { exit 1 } + if ($lastExitCode -ne "0") { + Write-Host "Let's try to wake '$remoteHost' up..." + & "$PSScriptRoot/wake-up-host.ps1" + } Write-Host "⏳ Connecting as user '$remoteUser' using " -noNewline & ssh -V diff --git a/scripts/ping-host.ps1 b/scripts/ping-host.ps1 index b5f841da..e0373295 100755 --- a/scripts/ping-host.ps1 +++ b/scripts/ping-host.ps1 @@ -27,7 +27,7 @@ function GetPingLatency([string]$hostname) { try { [int]$latency = GetPingLatency($hostname) if ($latency -eq 1500) { - Write-Host "⚠️ Host '$hostname' doesn't respond - check the connection or wake the host up." + Write-Host "⚠️ Host '$hostname' doesn't respond - check the connection or maybe the host is down." exit 1 } Write-Host "✅ $hostname is up and running ($($latency)ms latency)."