From: Stefan Schantl Date: Sun, 24 Jul 2022 12:23:12 +0000 (+0200) Subject: tor.cgi: Use suricata service ports mechanism. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8fe0d49e6a5635bfc041b9894affe6bc5ad3bbf;p=people%2Fstevee%2Fipfire-2.x.git tor.cgi: Use suricata service ports mechanism. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index 539a743438..098427181b 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.