Update gravity-sync.sh

This commit is contained in:
Michael Stanclift 2020-05-25 14:03:15 -05:00
parent 4b47893026
commit 0f18aa94fa

View File

@ -279,9 +279,9 @@ function validate_os_sshpass {
SSHPASSWORD=''
MESSAGE="Using SSH Key-Pair Authentication"
else
ssh -o ConnectTimeout=5 -o BatchMode=yes -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'exit'
ssh -o ConnectTimeout=5 -o BatchMode=yes -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'exit' >/dev/null 2>&1
if [ "$?" != "0" ]; then
SSHPASSWORD="sshpass -p '${REMOTE_PASS}' "
SSHPASSWORD="sshpass -p ${REMOTE_PASS}"
MESSAGE="Using SSH Password Authentication"
else
sshpassword=''
@ -298,7 +298,7 @@ function validate_os_sshpass {
MESSAGE="Testing SSH Connection"
echo -e "$STAT $MESSAGE"
${sshpassword}ssh -o ConnectTimeout=5 -o BatchMode=yes -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'exit'
${sshpassword} ssh -o ConnectTimeout=5 -o BatchMode=yes -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'exit'
error_validate
}