Add SSHPASS validation

This commit is contained in:
Michael Stanclift 2020-05-24 21:15:08 -05:00
parent b87c6c2e70
commit 7ab04ea424

View File

@ -205,12 +205,14 @@ function push_gs {
# Logging Functions
## Check Log Function
function logs_gs {
echo -e "Recent ${YELLOW}PULL${NC} attempts"
echo -e "========================================================"
echo -e "Recent Complete ${YELLOW}PULL${NC} Executions"
tail -n 10 ${SYNCING_LOG} | grep PULL
echo -e "Recent ${YELLOW}UPDATE${NC} attempts"
echo -e "Recent Complete ${YELLOW}UPDATE${NC} Executions"
tail -n 10 ${SYNCING_LOG} | grep UPDATE
echo -e "Recent ${YELLOW}PUSH${NC} attempts"
echo -e "Recent Complete ${YELLOW}PUSH${NC} Executions"
tail -n 10 ${SYNCING_LOG} | grep PUSH
echo -e "========================================================"
exit_nochange
}
@ -269,6 +271,21 @@ function validate_ph_folders {
fi
}
## Validate SSHPASS
function validate_os_sshpass {
if hash sshpass 2>/dev/null
then
if ${REMOTE_PASS} != ''
then
sshpassword="sshpass -p ${REMOTE_PASS}"
else
sshpassword=''
fi
else
sshpassword=''
fi
}
# List GS Arguments
function list_gs_arguments {
echo -e "Usage: $0 [options]"
@ -345,7 +362,7 @@ function md5_compare {
# SCRIPT EXECUTION ###########################
show_version
validate_os_sshpass
MESSAGE="Evaluating Script Arguments"
echo -e "${STAT} ${MESSAGE}"