diff --git a/root/etc/fail2ban/action.d/smeserver.conf b/root/etc/fail2ban/action.d/smeserver.conf index 16e5a3d..d14e5c7 100644 --- a/root/etc/fail2ban/action.d/smeserver.conf +++ b/root/etc/fail2ban/action.d/smeserver.conf @@ -1,9 +1,10 @@ [Definition] -actionban = /sbin/e-smith/smeserver-fail2ban --host= --proto= --port= +actionban = /sbin/e-smith/smeserver-fail2ban --host= --proto= --port= --bantime= actionunban = /sbin/e-smith/smeserver-fail2ban --host= --unban --proto= --port= [Init] protocol = undef port = undef +bantime = undef diff --git a/root/sbin/e-smith/smeserver-fail2ban b/root/sbin/e-smith/smeserver-fail2ban index 6a4e7c4..d1605d4 100644 --- a/root/sbin/e-smith/smeserver-fail2ban +++ b/root/sbin/e-smith/smeserver-fail2ban @@ -74,12 +74,14 @@ GetOptions( "unban" => \$opts{unban}, "protocol=s" => \$opts{proto}, "port=s" => \$opts{port}, - "bantime=i" => \$opts{bantime} + "bantime=s" => \$opts{bantime} ); # special "undef" value for port and proto undef $opts{proto} if ($opts{proto} eq 'undef'); undef $opts{port} if ($opts{port} eq 'undef'); +$opts{bantime} = ($f2b->prop('BanTime') || '1800') + if ($opts{bantime} eq 'undef'); # Check options are valid