From df82e8d6d0e7ececc616603b3996e456b2e0a934 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Mon, 1 Jun 2020 13:08:18 -0500 Subject: [PATCH] Check for dbclient on validation --- gravity-sync.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gravity-sync.sh b/gravity-sync.sh index 0e5f9e6..d81e9cc 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -589,8 +589,15 @@ function validate_os_sshpass { MESSAGE="Validating SSH Connection to ${REMOTE_HOST}" echo_stat + if hash ssh 2>/dev/null + then timeout 5 ${SSHPASSWORD} ${SSH_CMD} -p ${SSH_PORT} -i '$HOME/${SSH_PKIF}' -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'exit' >/dev/null 2>&1 error_validate + elif hash dbclient ssh 2>/dev/null + then + timeout 5 ${SSHPASSWORD} ${SSH_CMD} -p ${SSH_PORT} -i '$HOME/${SSH_PKIF}' ${REMOTE_USER}@${REMOTE_HOST} 'exit' >/dev/null 2>&1 + error_validate + fi }