Add ssh timeout

This commit is contained in:
Sergey Stepanov 2021-08-25 14:15:27 +03:00
parent e770f1c77e
commit 37d63e875c
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B

View file

@ -87,7 +87,7 @@ function remote_sudo_run_once() {
f=$2/run-once.sh
if [[ -e "$f" ]]; then
echo >&2 "execute remotely $f:"$'\n'"$(cat $f)"$'\n'
ssh $USER@$1 -t $3 sudo sh < $f
ssh -o ConnectTimeout=10 $USER@$1 -t $3 sudo sh < $f
fi
fi
}
@ -202,7 +202,7 @@ for ip in $IP_LIST; do
echo "Update the remote host"
ssh $USER@$ip ${ssh_i:-} "\
ssh -o ConnectTimeout=10 $USER@$ip ${ssh_i:-} "\
mkdir -p $REMOTE_WORK_DIR; \
cd $REMOTE_WORK_DIR; \
echo '$compose_src' > ./docker-compose.yml; \