pass bantime arg to smeserver-fail2ban action

tags/0.0.1
Daniel Berteaud 12 years ago
parent daa6416b13
commit 0ba11fc416
  1. 3
      root/etc/fail2ban/action.d/smeserver.conf
  2. 4
      root/sbin/e-smith/smeserver-fail2ban

@ -1,9 +1,10 @@
[Definition]
actionban = /sbin/e-smith/smeserver-fail2ban --host=<ip> --proto=<protocol> --port=<port>
actionban = /sbin/e-smith/smeserver-fail2ban --host=<ip> --proto=<protocol> --port=<port> --bantime=<bantime>
actionunban = /sbin/e-smith/smeserver-fail2ban --host=<ip> --unban --proto=<protocol> --port=<port>
[Init]
protocol = undef
port = undef
bantime = undef

@ -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

Loading…
Cancel
Save