From 8b35d480d2204dec7aa9cb1d3a0d41da5d8aa6f8 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sun, 24 Jul 2022 14:23:12 +0200 Subject: [PATCH] tor.cgi: Use suricata service ports mechanism. Signed-off-by: Stefan Schantl --- html/cgi-bin/tor.cgi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index 9aa2bc95a..545d5e39f 100644 --- a/html/cgi-bin/tor.cgi +++ b/html/cgi-bin/tor.cgi @@ -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. -- 2.39.5