#!/bin/bash # crontab -e # * * * * * /bin/bash /etc/template_setup/scripts/systemctl-alive.sh service=$@ /bin/systemctl -q is-active "$service.service" status=$? if [ "$status" == 0 ]; then echo "OK" else /bin/systemctl start "$service.service" fi