Skip to content

Instantly share code, notes, and snippets.

@jmnsf
Created August 15, 2018 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmnsf/822b10741526452488719bc2bd956dcc to your computer and use it in GitHub Desktop.
Save jmnsf/822b10741526452488719bc2bd956dcc to your computer and use it in GitHub Desktop.
Rerun any command that exists with non-zero status.
#!/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