From 0cb52e77c62fef1fc8bb3612a151e965be3f8cd6 Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Mon, 25 May 2020 11:33:51 -0500 Subject: [PATCH] timeout for inital ssh connection --- gravity-sync.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gravity-sync.sh b/gravity-sync.sh index 36f5082..73beba7 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -12,7 +12,7 @@ VERSION='1.3.1' # REQUIRED SETTINGS ########################## -# You MUST define REMOTE_HOST and REMOTE_USER in a file called 'gravity-sync.conf' OK +# You MUST define REMOTE_HOST and REMOTE_USER in a file called 'gravity-sync.conf' # You can copy the 'gravity-sync.conf.example' file in the script directory to get started # STANDARD VARIABLES ######################### @@ -347,7 +347,7 @@ function md5_compare { MESSAGE="Analyzing Remote ${GRAVITY_FI}" echo -e "${STAT} ${MESSAGE}" - primaryMD5=$(ssh ${REMOTE_USER}@${REMOTE_HOST} 'md5sum /etc/pihole/gravity.db') + primaryMD5=$(ssh -o ConnectTimeout 10 -o BatchMode=yes -o StrictHostKeyChecking=no ${REMOTE_USER}@${REMOTE_HOST} 'md5sum /etc/pihole/gravity.db') error_validate MESSAGE="Analyzing Local ${GRAVITY_FI}"