first commit
This commit is contained in:
14
templates/fail2ban-check-ip.j2
Normal file
14
templates/fail2ban-check-ip.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
target_ip=$1
|
||||
check_ip_config='/usr/local/etc/scripts/custom.fail2ban-check-ip.conf'
|
||||
|
||||
test -s "${check_ip_config}" && . "${check_ip_config}"
|
||||
function check_ip_in_ipset() {
|
||||
for list in "${check_ip_lists[@]}"; do
|
||||
/sbin/ipset save "${list}" | grep -qE "${target_ip}" && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
check_ip_in_ipset
|
||||
Reference in New Issue
Block a user