]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
tor.cgi: Use suricata service ports mechanism.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 24 Jul 2022 12:23:12 +0000 (14:23 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 24 Jul 2022 12:23:12 +0000 (14:23 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/tor.cgi

index 539a7434383751c2dab6be089b92074868393a28..098427181b1aec0b90e64b50012d6f5e2726581c 100644 (file)
@@ -27,6 +27,7 @@ use strict;
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/location-functions.pl";
+require "${General::swroot}/ids-functions.pl";
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
@@ -203,6 +204,19 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) {
 
                # Update configuration files.
                &BuildConfiguration();
+
+               # Check if the IDS is running.
+               if(&IDS::ids_is_running()) {
+                       # Re-generate the service and ports related file.
+                       &IDS::generate_service_ports_file();
+
+                       # Re-generate used rulesfiles file.
+                       my @enabled_providers = &IDS::get_enabled_providers();
+                       &IDS::write_used_rulefiles_file(@enabled_providers);
+
+                       # Call suricatactrl to perform a reload.
+                       &IDS::call_suricatactrl("reload");
+               }
        }
 } else {
        # Load settings from file.