79479645

Date: 2025-03-02 19:54:51
Score: 1.5
Natty:
Report link
    #!/bin/bash
SERVICE="fail2ban"
if pgrep -f "$SERVICE" >/dev/null
then
    echo "$SERVICE is running"
else
    echo "$SERVICE stopped" >> /var/log/fail2ban_restart.log
    /etc/init.d/fail2ban start
    # mail  
fi

This program is working.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Tomasz M