You can create another script that runs every minute or 10 minutes to monitor. For example:
#!/bin/bash
WHAT="phoenix"
CMD=`sudo ps -ef | grep -v grep | grep ${WHAT} | wc | awk '{print $1}'`
if [ ${CMD} -le 0 ]; then
echo "stopped running. restart here."
exit 1
else
echo "it's running. no need to do anything."
fi
exit 0
This will look for a running instance of
phoenix. Of course, if you have more than one instance, you may have to fine tune what you are searching for to make it unique. I have something similar that checks to make sure my miners are running. And if it doesn't find it, the miner gets restarted.