This is what I have so far:
until python MyApp.py; do echo "App crashed... restarting..." >&2 sleep 1 done
This will re-run the program when it crashes, but not when the program finishes on its own.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community