From 912d7472a86b1347f3165c1850ed05ba2b7b641f Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Thu, 31 Jan 2019 08:55:05 +0100 Subject: [PATCH] ids.cgi: Automatically download ruleset if the ruleset source has been changed. Signed-off-by: Stefan Schantl --- html/cgi-bin/ids.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index ba2136b2f9..ae644876c2 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -323,8 +323,8 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'save'}) { &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'}"; -- 2.39.2