Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- while :;do
- estado=$(systemctl is-active nginx.service)
- if [ "$estado" != "active" ];then
- echo "$(date) - Se detuvo el servicio 'nginx', iniciando..."
- echo "systemctl start nginx.service"
- systemctl start nginx.service
- fi
- sleep 5
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement