Last active
February 17, 2017 11:03
-
-
Save tundeaoni/7ff71ca30be6c4cb671913fc9dce271e to your computer and use it in GitHub Desktop.
tiny bash script to retry task until it returns exit code 0
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
# !/bin/bash | |
readonly TIME_OUT=1 | |
STATUS=1 | |
printf "Command: %s \n" $@ | |
#pass command | |
while [ "$STATUS" -ne 0 ] | |
do | |
"$@" | |
STATUS=$? | |
sleep $TIME_OUT | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment