From mboxrd@z Thu Jan  1 00:00:00 1970
From: Stefan Schantl <stefan.schantl@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH] ids.cgi: Fix logic if suricata needs to be restarted.
Date: Mon, 06 Apr 2020 14:34:21 +0200
Message-ID: <20200406123421.3162-1-stefan.schantl@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3119979981055741602=="
List-Id: <development.lists.ipfire.org>

--===============3119979981055741602==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
 html/cgi-bin/ids.cgi | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi
index df7138e08..bc31a341f 100644
--- a/html/cgi-bin/ids.cgi
+++ b/html/cgi-bin/ids.cgi
@@ -417,17 +417,17 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) {
=20
 	# 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 rule=
files.
+			$suricata_restart_required =3D 1;
+		}
+
 		# Check if the rulefile is enabled.
 		if ($cgiparams{$rulefile} eq "on") {
 			# Add rulefile to the array of enabled rulefiles.
 			push(@enabled_rulefiles, $rulefile);
=20
-			# 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 rul=
efiles.
-				$suricata_restart_required =3D 1;
-			}
-
 			# Drop item from cgiparams hash.
 			delete $cgiparams{$rulefile};
 		}
--=20
2.26.0


--===============3119979981055741602==--