mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Delete scan results. (#7730)
This commit is contained in:
parent
d812ae6043
commit
d1de3afdf8
1 changed files with 11 additions and 2 deletions
|
|
@ -83,10 +83,15 @@ end
|
|||
|
||||
-- **********************************************************
|
||||
|
||||
local function get_report_path(scan_type, ip)
|
||||
local function get_report_path(scan_type, ip, all)
|
||||
local base_dir = dirs.workingdir .. "/-1/vulnerability_scan"
|
||||
ntop.mkdir(base_dir)
|
||||
local ret = base_dir .. "/"..ip.."_"..scan_type..".txt"
|
||||
local ret = ""
|
||||
if (not all or all == nil) then
|
||||
ret = base_dir .. "/"..ip.."_"..scan_type..".txt"
|
||||
else
|
||||
ret = base_dir .. "/*.txt"
|
||||
end
|
||||
|
||||
return(ret)
|
||||
end
|
||||
|
|
@ -380,9 +385,13 @@ function vs_utils.delete_host_to_scan(host, scan_type, all)
|
|||
if all then
|
||||
|
||||
ntop.delCache(host_to_scan_key)
|
||||
local path_to_s_result = get_report_path(scan_type, host, true)
|
||||
os.execute("rm "..path_to_s_result)
|
||||
else
|
||||
|
||||
local host_hash_key = vs_utils.get_host_hash_key(host, scan_type)
|
||||
local path_to_s_result = get_report_path(scan_type, host, false)
|
||||
os.remove(path_to_s_result)
|
||||
ntop.delHashCache(host_to_scan_key, host_hash_key)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue