Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash retry with timeout
# 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