Created
August 2, 2025 08:31
-
-
Save un4ckn0wl3z/3ed28acac88faaab928be665e5564384 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
while true; do | |
./YOUR_PROGRAM | |
EXIT_CODE=$? | |
if [ $EXIT_CODE -eq 0 ]; then | |
echo "Exited successfully, not restarting." | |
break | |
else | |
echo "Exited with error code $EXIT_CODE, restarting..." | |
sleep 1 # Optional delay before retry | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment