342 |
diff -Nur smeserver-fail2ban-0.1.18.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm smeserver-fail2ban-0.1.18/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm |
diff -Nur smeserver-fail2ban-0.1.18.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm smeserver-fail2ban-0.1.18/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm |
343 |
--- smeserver-fail2ban-0.1.18.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm 1969-12-31 19:00:00.000000000 -0500 |
--- smeserver-fail2ban-0.1.18.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm 1969-12-31 19:00:00.000000000 -0500 |
344 |
+++ smeserver-fail2ban-0.1.18/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm 2019-04-09 22:35:27.295000000 -0400 |
+++ smeserver-fail2ban-0.1.18/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/fail2ban.pm 2019-04-09 22:35:27.295000000 -0400 |
345 |
@@ -0,0 +1,419 @@ |
@@ -0,0 +1,428 @@ |
346 |
+#!/usr/bin/perl -w |
+#!/usr/bin/perl -w |
347 |
+ |
+ |
348 |
+package esmith::FormMagick::Panel::fail2ban; |
+package esmith::FormMagick::Panel::fail2ban; |
361 |
+ |
+ |
362 |
+our @EXPORT = qw(get_value get_prop change_settings RemoveIP); |
+our @EXPORT = qw(get_value get_prop change_settings RemoveIP); |
363 |
+ |
+ |
364 |
+our $VERSION = sprintf '%d.%03d', q$Revision: 1.00 $ =~ /: (\d+).(\d+)/; |
+our $VERSION = sprintf '%d.%03d', q$Revision: 1.2 $ =~ /: (\d+).(\d+)/; |
365 |
+our $db = esmith::ConfigDB->open |
+our $db = esmith::ConfigDB->open |
366 |
+ || warn "Couldn't open configuration database (permissions problems?)"; |
+ || warn "Couldn't open configuration database (permissions problems?)"; |
367 |
+my $scriptname = basename($0); |
+my $scriptname = basename($0); |
678 |
+ # for the 9 services update unless key does not exist and property does not exist and value eq default |
+ # for the 9 services update unless key does not exist and property does not exist and value eq default |
679 |
+ foreach my $key (keys %services) |
+ foreach my $key (keys %services) |
680 |
+ { |
+ { |
681 |
+ $rec = $db->get($key); |
+ if ($key eq "wordpress") |
682 |
+ my $getprop = $db->get_prop($key,'Fail2Ban') || ""; |
+ { |
683 |
+ $rec->set_prop('Fail2Ban', $services{$key} ) unless ( ! $rec || (! $db->get_prop($key,'Fail2Ban') && $services{$key} eq $defaultval{$key} ) ); |
+ $rec = $db->get('fail2ban'); |
684 |
|
+ my $getprop = $db->get_prop('fail2ban',$key) || ""; |
685 |
|
+ $rec->set_prop($key, $services{$key} ) unless ( ! $rec || (! $db->get_prop('fail2ban', $key) && $services{$key} eq $defaultval{$key} ) ); |
686 |
|
+ } |
687 |
|
+ else |
688 |
|
+ { |
689 |
|
+ $rec = $db->get($key); |
690 |
|
+ my $getprop = $db->get_prop($key,'Fail2Ban') || ""; |
691 |
|
+ $rec->set_prop('Fail2Ban', $services{$key} ) unless ( ! $rec || (! $db->get_prop($key,'Fail2Ban') && $services{$key} eq $defaultval{$key} ) ); |
692 |
|
+ } |
693 |
+ } |
+ } |
694 |
+# this seems to prevent reload of service if we update something and remove or add an ip... |
+# this seems to prevent reload of service if we update something and remove or add an ip... |
695 |
+# return '' unless $fm->add_new_valid_from; |
+# return '' unless $fm->add_new_valid_from; |
781 |
+fail2ban-client status $SERVI |grep -E 'IP list|Status for the jail' |sed 'N;s/\n/:/'|cut -d: -f2,4 |
+fail2ban-client status $SERVI |grep -E 'IP list|Status for the jail' |sed 'N;s/\n/:/'|cut -d: -f2,4 |
782 |
+done |
+done |
783 |
+ |
+ |
784 |
|
diff -Nur smeserver-fail2ban-0.1.18.old/createlinks smeserver-fail2ban-0.1.18/createlinks |
785 |
|
--- smeserver-fail2ban-0.1.18.old/createlinks 2017-10-27 08:34:58.000000000 -0400 |
786 |
|
+++ smeserver-fail2ban-0.1.18/createlinks 2019-04-09 23:39:11.772000000 -0400 |
787 |
|
@@ -2,6 +2,8 @@ |
788 |
|
|
789 |
|
use esmith::Build::CreateLinks qw(:all); |
790 |
|
|
791 |
|
+panel_link("fail2ban", "manager"); |
792 |
|
+ |
793 |
|
templates2events("/etc/rc.d/init.d/masq", "fail2ban-update"); |
794 |
|
|
795 |
|
foreach my $event qw(fail2ban-conf bootstrap-console-save){ |