From 53480c72bc7369395564cf91c1ad1b238d39bddc Mon Sep 17 00:00:00 2001 From: Geir Okkenhaug Jerstad Date: Thu, 12 Jun 2025 21:21:59 +0200 Subject: [PATCH] Improve lab status command to check both LAN and Tailscale connectivity --- packages/home-lab-tools.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/home-lab-tools.nix b/packages/home-lab-tools.nix index 9385b03..96fa98a 100644 --- a/packages/home-lab-tools.nix +++ b/packages/home-lab-tools.nix @@ -130,8 +130,12 @@ writeShellScriptBin "lab" '' # Check remote machines 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 - success " $machine: ✓ Online" + # Try with normal SSH first (for LAN) + 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 warn " $machine: ⚠ Unreachable" fi