Hello all,

I'm using CentOS Linux 7 and Fail2Ban v0.9.6.
I'd created a script for Whitelisting IP from our database, and I used it
in the jail.local like "ignorecommand
=/etc/fail2ban/filter.d/ignorecommands/check_ip.sh <ip>"

Please find the script below.

-----------------
#!/bin/bash
ip=$1
myip= mysql -uuser -ppassword -s -N -e "SELECT if(fw_id is not null,1,0)
FROM db.table WHERE fw_ip='$1'"
if [ "$myip" == "$ip" ]; then
exit 0
else
exit 1
fi
------------------

in the log, I find that
[31611]: ERROR   /etc/fail2ban/filter.d/ignorecommands/check_ip.sh
192.168.1.2 -- stdout: '1\n'
[31611]: ERROR   /etc/fail2ban/filter.d/ignorecommands/check_ip.sh
192.168.1.2 -- stderr: ''
[31611]: ERROR   /etc/fail2ban/filter.d/ignorecommands/check_ip.sh
192.168.1.2 -- returned 1
[31611]: INFO    [nginx-botsearch] Found 192.168.1.2

the same script is working on another server but there is a change in the
version, Fail2Ban v0.9.7. on another server version is Fail2Ban v0.9.6, Is
there might be an issue of version or anything else?
Please reply if you've any idea on this.


Thanks and Regards,
Jaydeep Zala
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fail2ban-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fail2ban-users

Reply via email to