From: alex Date: Sat, 21 Dec 2024 19:15:13 +0000 (-0800) Subject: ssh: improve error handling on connection failure X-Git-Tag: v1.2.0~1 X-Git-Url: http://git.infiniteadaptability.org/?a=commitdiff_plain;h=fc46f85547bcd61f2139df65390587367663a960;p=mirror-all ssh: improve error handling on connection failure --- diff --git a/mirror-all b/mirror-all index c6c975b..8ccbd8e 100755 --- a/mirror-all +++ b/mirror-all @@ -123,12 +123,12 @@ find_remote_directories() { log_info "finding all git repos in $SERVER:$TARGET" - readarray -d '' repos < <("$SSH" "$SERVER" -- "$LS" "$TARGET" --zero) + readarray -d '' repos < <("$SSH" -o BatchMode=yes "$SERVER" -- "$LS" "$TARGET" --zero 2>/dev/null) for i in "${repos[@]}"; do set +e local target="$TARGET/${i}" - if [[ "true" == "$("$SSH" "$SERVER" -- "$GIT" -C "$target" rev-parse --is-bare-repository 2>&1)" ]]; then + if [[ "true" == "$("$SSH" -o BatchMode=yes "$SERVER" -- "$GIT" -C "$target" rev-parse --is-bare-repository 2>&1)" ]]; then if [[ -d "$i" ]]; then TO_FETCH+=("$SERVER:$target") else