With systemd, you can restart failed services with the following directive. You don't necessarily need to use a script.I am using following commands to check status and start qbittorrent. I am also attaching output of each of them...
...
Restart=on-failure
More here: https://ma.ttias.be/auto-restart-crashed-service-systemd/