Service Monitor
#!/bin/bash
SERVICES=("nginx" "mysql" "redis")
while true; do
for svc in "${SERVICES[@]}"; do
systemctl is-active --quiet "$svc" || (echo "Restarting $svc"; systemctl restart "$svc")
done
sleep 60
done - service
- monitor
- systemd
- restart
- watchdog