Created
March 24, 2017 06:20
-
-
Save jsidhu/90e4f30cff0d0f1bc8c69add08826e97 to your computer and use it in GitHub Desktop.
simple shell script to retry ssh repeatedly till connection succeeds.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do | |
ssh -o ConnectTimeout=1 -o ConnectionAttempts=1 $@; | |
RESULT=$? | |
if [ "${RESULT}" -eq 0 ]; then | |
break | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment