X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/rcheck/blobdiff_plain/0c159fe7698d0a510b649e645c1c5e680eee37e6..b742457ebfd03ae5d11995d3d26009eef7e1ca85:/rcheck diff --git a/rcheck b/rcheck index cd40440..318aab6 100755 --- a/rcheck +++ b/rcheck @@ -12,11 +12,15 @@ do prog=$(readlink "${prog##*/}") done +exec 4>&1 +rc=0 for host in "$@"; do - { { { set +e - tar czf - check check.d | - ssh "$host" ' + nrc=$( + exec 5>&1 + { { { set +e + tar czf - check check.d | + ssh "$host" ' set -e cd /tmp @@ -34,21 +38,25 @@ cd $tmpdir tar xzf - ./check' - rc=$?; set -e - case $rc in - 0) ;; - *) echo >&2 "remote check process failed (rc = $rc)" ;; - esac - } 1>&3; } 2>&1 | - sed 's/^/!!! /' - } 3>&1 | - if read line; then - cat <&5 + case $rc in + 0) ;; + *) echo >&2 "remote check process failed (rc = $rc)" ;; + esac + } 1>&3; } 2>&1 | + sed 's/^/!!! /' + } 3>&1 | + if IFS= read -r line; then + cat <&4 + ) + if [ $nrc -gt $rc ]; then rc=$nrc; fi done + +exit $rc