From 9b03cec23e6f02d2f0d1867bf4e65cf1f6031ea1 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Mon, 2 Mar 2026 00:52:24 +0000 Subject: [PATCH] fix: correctly propagate remote command exit status --- nixos/kubeadm/scripts/rebuild-and-bootstrap.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/kubeadm/scripts/rebuild-and-bootstrap.sh b/nixos/kubeadm/scripts/rebuild-and-bootstrap.sh index ca86980..678d467 100755 --- a/nixos/kubeadm/scripts/rebuild-and-bootstrap.sh +++ b/nixos/kubeadm/scripts/rebuild-and-bootstrap.sh @@ -97,12 +97,14 @@ remote() { quoted_cmd="$(printf '%q' "$cmd")" for candidate in "${candidates[@]}"; do - if ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd"; then + ssh $SSH_OPTS "$candidate@$host_ip" "bash -lc $quoted_cmd" + rc=$? + + if [ "$rc" -eq 0 ]; then ACTIVE_SSH_USER="$candidate" return 0 fi - rc=$? if [ "$rc" -ne 255 ]; then return "$rc" fi -- 2.49.1