Check if fail2ban is running (#2626)

This commit is contained in:
Casper 2022-06-07 13:42:06 +02:00 committed by GitHub
parent 72650d4dc3
commit 8e0fd306b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,8 @@ source /usr/local/bin/helpers/index.sh
function __usage { echo "Usage: ./setup.sh fail2ban [<ban|unban> <IP>]" ; } function __usage { echo "Usage: ./setup.sh fail2ban [<ban|unban> <IP>]" ; }
fail2ban-client ping &>/dev/null || _exit_with_error "Fail2ban not running"
unset JAILS unset JAILS
declare -a JAILS declare -a JAILS
IP_REGEXP='((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' IP_REGEXP='((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'