Created
August 15, 2018 12:09
-
-
Save jmnsf/822b10741526452488719bc2bd956dcc to your computer and use it in GitHub Desktop.
Rerun any command that exists with non-zero status.
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/sh | |
# Reruns any command when it exits with non-zero status. | |
while : | |
do | |
if eval $@ ; then | |
break | |
fi | |
echo "Died... Re-trying in 1 second." | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment