mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Refresh blacklist rules when blacklist alert preference changes
This commit is contained in:
parent
2141004cc6
commit
c40075486f
2 changed files with 14 additions and 4 deletions
|
|
@ -28,16 +28,22 @@ end
|
|||
|
||||
-- ##################################################################
|
||||
|
||||
function loadHostBlackList()
|
||||
function loadHostBlackList(force_purge)
|
||||
local bl = ntop.getCache("ntopng.prefs.host_blacklist")
|
||||
local bl_enabled = ((bl == "1") or (bl == "enabled"))
|
||||
local should_reload = ((bl_enabled) or (force_purge))
|
||||
|
||||
if((bl == "1") or (bl == "enabled")) then
|
||||
if should_reload then
|
||||
ntop.allocHostBlacklist()
|
||||
|
||||
end
|
||||
|
||||
if bl_enabled then
|
||||
for _,url in pairs(blacklistURLs) do
|
||||
loadBlackListFromURL(url)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if should_reload then
|
||||
ntop.swapHostBlacklist()
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue