Skip to content

Instantly share code, notes, and snippets.

@dan82840
Created June 10, 2021 09:25
Show Gist options
  • Save dan82840/6449437a4dad8cc743f78e9ce4fe9092 to your computer and use it in GitHub Desktop.
Save dan82840/6449437a4dad8cc743f78e9ce4fe9092 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
SSH=/usr/bin/ssh
SSH_CONNECT_TIMEOUT=5
for i in $(seq 1 3); do
eval "$SSH -o ConnectTimeout=$SSH_CONNECT_TIMEOUT $@"
ret=$?
if [ $ret -eq 0 -o $ret -eq 127 ]; then
exit $ret
fi
done
exit $ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment