From: Stefan Schantl Date: Mon, 22 Mar 2021 15:27:33 +0000 (+0100) Subject: ids.cgi: Move configuration of ruleset autoupdate intervall to IDS main X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a70d0cb06382f4ffc5eb05f88ebe90924ba5ab8;p=people%2Fstevee%2Fipfire-2.x.git ids.cgi: Move configuration of ruleset autoupdate intervall to IDS main section. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 5bc2e3689c..0e55e99b9f 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -351,12 +351,6 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) { # Store settings into settings file. &General::writehash("$IDS::rules_settings_file", \%cgiparams); - # Check if the the automatic rule update hass been touched. - if($cgiparams{'AUTOUPDATE_INTERVAL'} ne $oldsettings{'AUTOUPDATE_INTERVAL'}) { - # Call suricatactrl to set the new interval. - &IDS::call_suricatactrl("cron", $cgiparams{'AUTOUPDATE_INTERVAL'}); - } - # Check if a ruleset is present - if not or the source has been changed download it. if((! %idsrules) || ($oldsettings{'RULES'} ne $cgiparams{'RULES'})) { # Check if the red device is active. @@ -618,6 +612,12 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) { &General::writehash("$IDS::ids_settings_file", \%cgiparams); } + # Check if the the automatic rule update hass been touched. + if($cgiparams{'AUTOUPDATE_INTERVAL'} ne $oldidssettings{'AUTOUPDATE_INTERVAL'}) { + # Call suricatactrl to set the new interval. + &IDS::call_suricatactrl("cron", $cgiparams{'AUTOUPDATE_INTERVAL'}); + } + # Generate file to store the home net. &IDS::generate_home_net_file(); @@ -703,9 +703,9 @@ sub show_mainpage() { &General::readhash("$IDS::rules_settings_file", \%rulessettings); # If no autoupdate intervall has been configured yet, set default value. - unless(exists($rulessettings{'AUTOUPDATE_INTERVAL'})) { + unless(exists($idssettings{'AUTOUPDATE_INTERVAL'})) { # Set default to "weekly". - $rulessettings{'AUTOUPDATE_INTERVAL'} = 'weekly'; + $idssettings{'AUTOUPDATE_INTERVAL'} = 'weekly'; } # Read-in ignored hosts. @@ -866,6 +866,27 @@ END print < + + +

+

+

+

+ + + + $Lang::tr{'ids automatic rules update'} + + + + + + +