]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids.cgi: Automatically download ruleset if the ruleset source has been changed.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 31 Jan 2019 07:55:05 +0000 (08:55 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 31 Jan 2019 07:55:05 +0000 (08:55 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index ba2136b2f9bf5279cab6f49d91d79ad4a02719ff..ae644876c2190cfb86ed38e7a4ab13e1a3389f71 100644 (file)
@@ -323,8 +323,8 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
                &IDS::call_suricatactrl("cron", $cgiparams{'AUTOUPDATE_INTERVAL'});
        }
 
                &IDS::call_suricatactrl("cron", $cgiparams{'AUTOUPDATE_INTERVAL'});
        }
 
-       # Check if a ruleset is present - if not download it.
-       unless (%idsrules) {
+       # Check if a ruleset is present - if not or the source has been changed download it.
+       unless ((%idsrules) || ($oldsettings{'RULES'} eq $cgiparams{'RULES'})) {
                # Check if the red device is active.
                unless (-e "${General::swroot}/red/active") {
                        $errormessage = "$Lang::tr{'could not download latest updates'} - $Lang::tr{'system is offline'}";
                # Check if the red device is active.
                unless (-e "${General::swroot}/red/active") {
                        $errormessage = "$Lang::tr{'could not download latest updates'} - $Lang::tr{'system is offline'}";