Last active
February 24, 2020 20:28
-
-
Save Izumemori/c79c2bf37fcfcda2e924dc2b11bbda8b to your computer and use it in GitHub Desktop.
Your watcher script is bad hold mine
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 | |
QUIT_EXIT_CODE=1 | |
COMMAND=$@ | |
for (( ;; )) | |
do | |
$COMMAND | |
EXIT_CODE=$? | |
if [ $EXIT_CODE == $QUIT_EXIT_CODE ] | |
then | |
echo "Exiting..." | |
break | |
fi | |
echo "Application exited with exit code $EXIT_CODE, restarting..." | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment