From 1f53f7be788b6e88def379c77fd67a3b25525d7c Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 1 Oct 2019 23:43:42 +1000 Subject: Fork original mirror HEAD check to. 30 minutes to 3 minutes. B-) --- mirror-checker.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mirror-checker.lua b/mirror-checker.lua index 7e9cfbe..9ff81a2 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua @@ -10,6 +10,7 @@ local args = {...} They shouldn't have the proper certificate, but are giving a result anyway. ]] +origin = false verbosity = -1 keep = false -- TODO - Should actually implement this. @@ -284,6 +285,7 @@ checkHEAD = function (host, URL, r, retry) end local checkFiles = function (host, ip, path, file) + if nil == path then path = "" end if nil ~= file then if "redir" == ip then ip = host end I(" Checking IP for file " .. host .. " -> " .. ip .. " " .. path .. " " .. file) @@ -328,7 +330,8 @@ checkHost = function (orig, host, path, ip, file) else if orig == host then D("checkHost " .. orig .. "" .. file) - checkFiles(orig, orig, path); +-- checkFiles(orig, orig, path); + if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " -o " .. orig .. path .. " " .. file .." &") end else D("checkHost " .. orig .. " -> " .. host) end gatherIPs(ph.host) for k, v in pairs(IP[ph.host]) do @@ -435,6 +438,8 @@ if 0 ~= #args then keep = true elseif "-n" == a then fork = false + elseif "-o" == a then + origin = true elseif "--" == a:sub(1, 2) then local s, e = a:find("=") if nil == s then e = -1 end @@ -524,7 +529,11 @@ if 0 < #arg then checkExes(downloadLock) end end - checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) + if origin then + checkFiles(pu.host, pu.host, pu.path); + else + checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) + end logFile:close() else if not keep then os.execute("rm -f results/*.log") end -- cgit v1.1