From a3ceb11cbcb9a466dc54bd2bd5452448282dafd3 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 1 Jan 2020 14:35:36 +1000 Subject: Leave a log of the HEAD probe details. --- apt-panopticon.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 7604a98..3834ced 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -217,7 +217,7 @@ checkHEAD = function (host, URL, r, retry, sanity) local check = "HEAD testing file" local PU = url.parse(URL, defaultURL) local pu = url.parse(PU.scheme .. "://" .. host, defaultURL) - local fname = host .. "_" .. PU.host .. "_" .. PU.path:gsub("/", "_") .. ".txt" + local fname = host .. "_" .. PU.host .. "_" .. PU.path:gsub("/", "_") .. ".log.txt" local hdr = "" local IP = "" if pu.host ~= PU.host then @@ -330,10 +330,10 @@ checkHEAD = function (host, URL, r, retry, sanity) end if '???' == code then W(spcd .. spcd .. 'Could not find response code. ' .. APT.lnk(URL), PU.scheme, sanity, host) - else - os.execute('rm -f results/STATUS_' .. fname .. ' 2>/dev/null') end end + os.execute('cat results/STATUS_' .. fname .. ' >> results/curl_HEAD_' .. fname .. '; rm -f results/STATUS_' .. fname .. ' 2>/dev/null') + if ("4" == tostring(code):sub(1, 1)) or ("5" == tostring(code):sub(1, 1)) then E(spcd .. spcd .. code .. " " .. cstr .. ". " .. check .. " " .. APT.lnk(URL), PU.scheme, sanity, host) else -- cgit v1.1