]> 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>
Mon, 4 Mar 2024 18:47:40 +0000 (19:47 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/tor.cgi

index 9aa2bc95a1985e2f0e3b23311f0e34a26a10a2ec..545d5e39f0bd69e915079289f4d34f615e19fbb8 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.