Fail2ban integration on SME Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.3KB

  1. #!/usr/bin/perl -w
  2. use esmith::Build::CreateLinks qw(:all);
  3. templates2events("/etc/rc.d/init.d/masq", "fail2ban-update");
  4. foreach my $event qw(fail2ban-conf bootstrap-console-save){
  5. templates2events("/etc/fail2ban/jail.conf", "$event");
  6. templates2events("/etc/fail2ban/fail2ban.conf", "$event");
  7. templates2events("/etc/logrotate.d/fail2ban", "$event");
  8. }
  9. templates2events("/etc/fail2ban/jail.conf", "network-create");
  10. templates2events("/etc/fail2ban/jail.conf", "network-delete");
  11. templates2events("/etc/fail2ban/jail.conf", "remoteaccess-update");
  12. safe_symlink("adjust", "root/etc/e-smith/events/fail2ban-update/services2adjust/masq");
  13. safe_symlink("restart", "root/etc/e-smith/events/fail2ban-conf/services2adjust/fail2ban");
  14. safe_symlink("restart", "root/etc/e-smith/events/network-create/services2adjust/fail2ban");
  15. safe_symlink("restart", "root/etc/e-smith/events/network-delete/services2adjust/fail2ban");
  16. safe_symlink("restart", "root/etc/e-smith/events/remoteaccess-update/services2adjust/fail2ban");
  17. event_link("fail2ban-suspend-logs", "logrotate", "02");
  18. event_link("fail2ban-resume-logs", "logrotate", "98");
  19. safe_touch("root/var/log/fail2ban/daemon.log");
  20. service_link_enhanced("fail2ban", "S99", "7");
  21. service_link_enhanced("fail2ban", "K08", "6");
  22. service_link_enhanced("fail2ban", "K08", "0");