diff options
-rwxr-xr-x | mirror-checker.lua | 13 |
1 files 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 = {...} | |||
10 | They shouldn't have the proper certificate, but are giving a result anyway. | 10 | They shouldn't have the proper certificate, but are giving a result anyway. |
11 | ]] | 11 | ]] |
12 | 12 | ||
13 | origin = false | ||
13 | verbosity = -1 | 14 | verbosity = -1 |
14 | keep = false | 15 | keep = false |
15 | -- TODO - Should actually implement this. | 16 | -- TODO - Should actually implement this. |
@@ -284,6 +285,7 @@ checkHEAD = function (host, URL, r, retry) | |||
284 | end | 285 | end |
285 | 286 | ||
286 | local checkFiles = function (host, ip, path, file) | 287 | local checkFiles = function (host, ip, path, file) |
288 | if nil == path then path = "" end | ||
287 | if nil ~= file then | 289 | if nil ~= file then |
288 | if "redir" == ip then ip = host end | 290 | if "redir" == ip then ip = host end |
289 | I(" Checking IP for file " .. host .. " -> " .. ip .. " " .. path .. " " .. file) | 291 | I(" Checking IP for file " .. host .. " -> " .. ip .. " " .. path .. " " .. file) |
@@ -328,7 +330,8 @@ checkHost = function (orig, host, path, ip, file) | |||
328 | else | 330 | else |
329 | if orig == host then | 331 | if orig == host then |
330 | D("checkHost " .. orig .. "" .. file) | 332 | D("checkHost " .. orig .. "" .. file) |
331 | checkFiles(orig, orig, path); | 333 | -- checkFiles(orig, orig, path); |
334 | if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " -o " .. orig .. path .. " " .. file .." &") end | ||
332 | else D("checkHost " .. orig .. " -> " .. host) end | 335 | else D("checkHost " .. orig .. " -> " .. host) end |
333 | gatherIPs(ph.host) | 336 | gatherIPs(ph.host) |
334 | for k, v in pairs(IP[ph.host]) do | 337 | for k, v in pairs(IP[ph.host]) do |
@@ -435,6 +438,8 @@ if 0 ~= #args then | |||
435 | keep = true | 438 | keep = true |
436 | elseif "-n" == a then | 439 | elseif "-n" == a then |
437 | fork = false | 440 | fork = false |
441 | elseif "-o" == a then | ||
442 | origin = true | ||
438 | elseif "--" == a:sub(1, 2) then | 443 | elseif "--" == a:sub(1, 2) then |
439 | local s, e = a:find("=") | 444 | local s, e = a:find("=") |
440 | if nil == s then e = -1 end | 445 | if nil == s then e = -1 end |
@@ -524,7 +529,11 @@ if 0 < #arg then | |||
524 | checkExes(downloadLock) | 529 | checkExes(downloadLock) |
525 | end | 530 | end |
526 | end | 531 | end |
527 | checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) | 532 | if origin then |
533 | checkFiles(pu.host, pu.host, pu.path); | ||
534 | else | ||
535 | checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) | ||
536 | end | ||
528 | logFile:close() | 537 | logFile:close() |
529 | else | 538 | else |
530 | if not keep then os.execute("rm -f results/*.log") end | 539 | if not keep then os.execute("rm -f results/*.log") end |