-
Notifications
You must be signed in to change notification settings - Fork 14
/
createlinks
35 lines (28 loc) · 1.21 KB
/
createlinks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# actions to do
my $event = 'nethserver-fail2ban-update';
event_actions($event,
'initialize-default-databases' => '00',
'nethserver-fail2ban-cleanup' => '01',
'nethserver-fail2ban-clean-shorewall-dynamic' => '10');
templates2events("/etc/fail2ban/fail2ban.local", $event);
templates2events('/etc/fail2ban/action.d/sendmail-common.local', $event);
templates2events('/etc/sudoers', $event);
# nethserver-firewall-base-save
my $event = 'nethserver-firewall-base-save';
templates2events("/etc/fail2ban/fail2ban.local", $event);
templates2events('/etc/fail2ban/jail.local', $event);
#Action to unbanIP
my $event = 'nethserver-fail2banUnBan-save';
event_actions($event, 'fail2ban-unban' => '10');
# nethserver-fail2ban-save -> we need to expand/restart shorewall before Fail2ban
my $event = 'nethserver-fail2ban-save';
event_actions($event,
'nethserver-fail2ban-unban-whitelist' => '10',
'firewall-adjust' => '95');
templates2events('/etc/fail2ban/action.d/sendmail-common.local', $event);
# Fail2ban services restart
foreach my $event (qw ( nethserver-firewall-base-save )) {
event_services($event,'fail2ban'=> 'restart');
}