Update gravity-sync.sh

This commit is contained in:
Michael Stanclift 2020-05-25 14:31:46 -05:00
parent 1a3b8cb6e3
commit 4dfa4c1168

View File

@ -272,6 +272,8 @@ function validate_ph_folders {
## Validate SSHPASS ## Validate SSHPASS
function validate_os_sshpass { function validate_os_sshpass {
echo -e "${INFO} Checking SSH Configuration"
if hash sshpass 2>/dev/null if hash sshpass 2>/dev/null
then then
if test -z "$REMOTE_PASS" if test -z "$REMOTE_PASS"
@ -279,7 +281,7 @@ function validate_os_sshpass {
SSHPASSWORD='' SSHPASSWORD=''
MESSAGE="Using SSH Key-Pair Authentication" MESSAGE="Using SSH Key-Pair Authentication"
else else
ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'exit' >/dev/null 2>&1 timeout 5 ssh -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'exit' >/dev/null 2>&1
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
SSHPASSWORD="sshpass -p ${REMOTE_PASS}" SSHPASSWORD="sshpass -p ${REMOTE_PASS}"
MESSAGE="Using SSH Password Authentication" MESSAGE="Using SSH Password Authentication"