fix: correctly propagate remote command exit status #76

Merged
micqdf merged 1 commits from stage into master 2026-03-02 01:04:44 +00:00
Showing only changes of commit 9b03cec23e - Show all commits

View File

@@ -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