mirror of
https://github.com/vmstan/gravity-sync.git
synced 2024-08-30 18:22:11 +00:00
Update gravity-sync.sh
This commit is contained in:
parent
1a3b8cb6e3
commit
4dfa4c1168
@ -272,14 +272,16 @@ function validate_ph_folders {
|
|||||||
|
|
||||||
## Validate SSHPASS
|
## Validate SSHPASS
|
||||||
function validate_os_sshpass {
|
function validate_os_sshpass {
|
||||||
if hash sshpass 2>/dev/null
|
echo -e "${INFO} Checking SSH Configuration"
|
||||||
|
|
||||||
|
if hash sshpass 2>/dev/null
|
||||||
then
|
then
|
||||||
if test -z "$REMOTE_PASS"
|
if test -z "$REMOTE_PASS"
|
||||||
then
|
then
|
||||||
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user