]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ids.cgi: Fix logic if suricata needs to be restarted.
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 6 Apr 2020 12:34:21 +0000 (14:34 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 6 Apr 2020 14:02:59 +0000 (14:02 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/ids.cgi

index c3e5eefdbcadcf0cff58b402d443849e214dddc4..f76aade4933016134f3b1292198194b58a777896 100644 (file)
@@ -417,17 +417,17 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
 
        # Loop through the hash of idsrules.
        foreach my $rulefile(keys %idsrules) {
+               # Check if the state of the rulefile has been changed.
+               unless ($cgiparams{$rulefile} eq $idsrules{$rulefile}{'Rulefile'}{'State'}) {
+                       # A restart of suricata is required to apply the changes of the used rulefiles.
+                       $suricata_restart_required = 1;
+               }
+
                # Check if the rulefile is enabled.
                if ($cgiparams{$rulefile} eq "on") {
                        # Add rulefile to the array of enabled rulefiles.
                        push(@enabled_rulefiles, $rulefile);
 
-                       # Check if the state of the rulefile has been changed.
-                       unless ($cgiparams{$rulefile} eq $idsrules{$rulefile}{'Rulefile'}{'State'}) {
-                               # A restart of suricata is required to apply the changes of the used rulefiles.
-                               $suricata_restart_required = 1;
-                       }
-
                        # Drop item from cgiparams hash.
                        delete $cgiparams{$rulefile};
                }