From 7f6da17255ba90e3f7609eeeaff360d8b107cd3e Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 24 Dec 2019 15:08:42 +1000 Subject: Better log file names for IPs and files. --- apt-panopticon.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 81fd281..0d866d3 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -915,11 +915,11 @@ if 0 < #arg then if APT.origin or APT.redir then APT.results["IPs"] = gatherIPs(pu.host) end - if nil ~= arg[2] then - APT.logFile, e = io.open("results/LOG_" .. pu.host .. "_" .. arg[2] .. ".html", "a+") - else - APT.logFile, e = io.open("results/LOG_" .. pu.host .. ".html", "a+") - end + local logname = pu.host + if nil ~= arg[2] then logname = logname .. "_" .. arg[2] end + if nil ~= arg[3] then logname = logname .. "_" .. arg[3] end + if APT.checkFile("results/LOG_" .. logname .. ".html") then return end + APT.logFile, e = io.open("results/LOG_" .. logname .. ".html", "a+") if nil == APT.logFile then C("opening log file - " .. e); return end APT.logPre() I("Starting tests for " .. arg[1] .. " with these tests - " .. table.concat(APT.options.tests.value, ", ")) -- cgit v1.1