Improve lab status command to check both LAN and Tailscale connectivity

This commit is contained in:
Geir Okkenhaug Jerstad 2025-06-12 21:21:59 +02:00
parent 07903ac9e3
commit 53480c72bc

View file

@ -130,8 +130,12 @@ writeShellScriptBin "lab" ''
# Check remote machines # Check remote machines
for machine in sleeper-service grey-area reverse-proxy; do for machine in sleeper-service grey-area reverse-proxy; do
if ${openssh}/bin/ssh -o ConnectTimeout=5 -o BatchMode=yes "sma@$machine" "echo OK" >/dev/null 2>&1; then # Try with normal SSH first (for LAN)
success " $machine: Online" if ${openssh}/bin/ssh -o ConnectTimeout=2 -o BatchMode=yes "sma@$machine" "echo OK" >/dev/null 2>&1; then
success " $machine: Online (LAN)"
# Try with Tailscale hostname as fallback
elif ${openssh}/bin/ssh -o ConnectTimeout=2 -o BatchMode=yes "sma@$machine.tailnet" "echo OK" >/dev/null 2>&1; then
success " $machine: Online (Tailscale)"
else else
warn " $machine: Unreachable" warn " $machine: Unreachable"
fi fi