# Get all available blocklists.
my @blocklists = &IPblocklist::get_blocklists();
+# Array to store successfully update blocklists.
+# They need to be reloaded.
+my @updated_blocklists = ();
+
# Gather the details, when a list got modified last time.
my %modified = ();
} else {
# Log successfull update.
&_log_to_syslog("<INFO> Successfully updated $blocklist blocklist.");
+
+ # Add the list to the array of updated blocklists.
+ push(@updated_blocklists, $blocklist);
+ }
+}
+
+# Check if a blocklist has been updated and therefore needs to be reloaded.
+if (@updated_blocklists) {
+ # Loop through the array.
+ foreach my $updated_blocklist (@updated_blocklists) {
+ # Get the blocklist file.
+ my $ipset_db_file = &IPblocklist::get_ipset_db_file($updated_blocklist);
+
+ # Call safe system function to reload/update the blocklist.
+ &General::system("ipset", "restore", "-f", "$ipset_db_file");
}
}