From b31bb8d5db12f70d7c46214963997c7817624a95 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Mon, 27 Sep 2021 16:27:25 -0400 Subject: [PATCH] fix: ssh check would fail and not warn the user Signed-off-by: Devin Buhl --- configure.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure.sh b/configure.sh index b202b99b..254293bf 100755 --- a/configure.sh +++ b/configure.sh @@ -223,12 +223,11 @@ verify_ansible_hosts() { _has_envar "${node_password}" _has_envar "${node_control}" - test="$(ssh -q -o BatchMode=yes -o ConnectTimeout=5 "${!node_username}"@"${!var}" echo ok 2>&1)" - if [[ "${test}" != "ok" ]]; then + if ssh -q -o BatchMode=yes -o ConnectTimeout=5 "${!node_username}"@"${!var}" "true"; then + _log "INFO" "Successfully SSH'ed into host '${!var}' with username '${!node_username}'" + else _log "ERROR" "Unable to SSH into host '${!var}' with username '${!node_username}'" exit 1 - else - _log "INFO" "Successfully SSH'ed into host '${!var}' with username '${!node_username}'" fi done }