How to self terminate pod on crash

I’d like for my script in my docker image to auto terminate its own Runpod instance if the script crashes out

Presumably this could be set up easily with a .bat file:
‘Run script.py
Run uploadLog.py
Run shutdown.py

Does anyone have any templates or scripts I could go off of to do something like this with my docker image?
Was this page helpful?