14 lines
258 B
Bash
14 lines
258 B
Bash
#!/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
|