Created
August 7, 2019 13:47
-
-
Save thealanberman/73beb7c190031e462478d4199f407509 to your computer and use it in GitHub Desktop.
Bash retry with timeout
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
# Lifted from https://stackoverflow.com/a/12321815 | |
# Adjust command and retries as needed | |
NEXT_WAIT_TIME=0 | |
RETRIES=5 | |
until command || [[ "${NEXT_WAIT_TIME}" == "${RETRIES}" ]]; do | |
sleep $(( NEXT_WAIT_TIME++ )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment