diff options
Diffstat (limited to '')
-rwxr-xr-x | apt-panopticon.lua (renamed from mirror-checker.lua) | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mirror-checker.lua b/apt-panopticon.lua index 01082d9..c68ec48 100755 --- a/mirror-checker.lua +++ b/apt-panopticon.lua | |||
@@ -367,7 +367,7 @@ checkHost = function (orig, host, path, ip, file) | |||
367 | else | 367 | else |
368 | if orig == host then | 368 | if orig == host then |
369 | D("checkHost " .. orig .. "" .. file) | 369 | D("checkHost " .. orig .. "" .. file) |
370 | if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " -o " .. orig .. path .. " " .. file .." &") end | 370 | if testing("IPv4") then execute("ionice -c3 ./apt-panopticon.lua " .. sendArgs .. " -o " .. orig .. path .. " " .. file .." &") end |
371 | else D("checkHost " .. orig .. " -> " .. host) end | 371 | else D("checkHost " .. orig .. " -> " .. host) end |
372 | local h = mirrors[ph.host] | 372 | local h = mirrors[ph.host] |
373 | if nil == h then return end | 373 | if nil == h then return end |
@@ -375,16 +375,16 @@ checkHost = function (orig, host, path, ip, file) | |||
375 | if "table" == type(v) then | 375 | if "table" == type(v) then |
376 | for k1, v1 in pairs(v) do | 376 | for k1, v1 in pairs(v) do |
377 | if v1 == "A" then | 377 | if v1 == "A" then |
378 | if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " " .. k1 .. " " .. file .." &") end | 378 | if testing("IPv4") then execute("ionice -c3 ./apt-panopticon.lua " .. sendArgs .. " " .. orig .. path .. " " .. k1 .. " " .. file .." &") end |
379 | elseif v1 == "AAAA" then | 379 | elseif v1 == "AAAA" then |
380 | if testing("IPv6") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " [" .. k1 .. "] " .. file .. " &") end | 380 | if testing("IPv6") then execute("ionice -c3 ./apt-panopticon.lua " .. sendArgs .. " " .. orig .. path .. " [" .. k1 .. "] " .. file .. " &") end |
381 | end | 381 | end |
382 | end | 382 | end |
383 | else | 383 | else |
384 | if v == "A" then | 384 | if v == "A" then |
385 | if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " " .. k .. " " .. file .." &") end | 385 | if testing("IPv4") then execute("ionice -c3 ./apt-panopticon.lua " .. sendArgs .. " " .. orig .. path .. " " .. k .. " " .. file .." &") end |
386 | elseif v == "AAAA" then | 386 | elseif v == "AAAA" then |
387 | if testing("IPv6") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " [" .. k .. "] " .. file .. " &") end | 387 | if testing("IPv6") then execute("ionice -c3 ./apt-panopticon.lua " .. sendArgs .. " " .. orig .. path .. " [" .. k .. "] " .. file .. " &") end |
388 | end | 388 | end |
389 | end | 389 | end |
390 | end | 390 | end |
@@ -474,7 +474,7 @@ if 0 ~= #args then | |||
474 | if ("--help" == a) or ("-h" == a) then | 474 | if ("--help" == a) or ("-h" == a) then |
475 | print("I should write some docs, huh? Read README.md for instructions.") | 475 | print("I should write some docs, huh? Read README.md for instructions.") |
476 | elseif "--version" == a then | 476 | elseif "--version" == a then |
477 | print("mirror-checker-lua version 0.1 WIP development version") | 477 | print("apt-panopticon version 0.1 WIP development version") |
478 | elseif "-v" == a then | 478 | elseif "-v" == a then |
479 | verbosity = verbosity + 1 | 479 | verbosity = verbosity + 1 |
480 | sendArgs = sendArgs .. a .. " " | 480 | sendArgs = sendArgs .. a .. " " |
@@ -584,7 +584,7 @@ if 0 < #arg then | |||
584 | cut = cut + 1 | 584 | cut = cut + 1 |
585 | end | 585 | end |
586 | downloads(cut, pu.host, pu.path) | 586 | downloads(cut, pu.host, pu.path) |
587 | checkExes("mirror-checker.lua " .. sendArgs) | 587 | checkExes("apt-panopticon.lua " .. sendArgs) |
588 | checkExes(downloadLock) | 588 | checkExes(downloadLock) |
589 | end | 589 | end |
590 | end | 590 | end |
@@ -603,7 +603,7 @@ else | |||
603 | if not keep then os.execute("rm -f results/*.log") end | 603 | if not keep then os.execute("rm -f results/*.log") end |
604 | os.execute("rm -f results/*.check") | 604 | os.execute("rm -f results/*.check") |
605 | os.execute("mkdir -p results; touch results/stamp") | 605 | os.execute("mkdir -p results; touch results/stamp") |
606 | logFile, e = io.open("results/mirror-checker-lua.log", "a+") | 606 | logFile, e = io.open("results/apt-panopticon.log", "a+") |
607 | if nil == logFile then C("opening log file - " .. e); return end | 607 | if nil == logFile then C("opening log file - " .. e); return end |
608 | I("Starting tests " .. table.concat(options.tests.value, ", ")) | 608 | I("Starting tests " .. table.concat(options.tests.value, ", ")) |
609 | execute("mkdir -p results") | 609 | execute("mkdir -p results") |
@@ -621,11 +621,11 @@ else | |||
621 | local pu = url.parse("http://" .. m.BaseURL) | 621 | local pu = url.parse("http://" .. m.BaseURL) |
622 | if options.referenceSite.value ~= pu.host then | 622 | if options.referenceSite.value ~= pu.host then |
623 | checkHost(m.BaseURL) | 623 | checkHost(m.BaseURL) |
624 | checkExes("mirror-checker.lua " .. sendArgs) | 624 | checkExes("apt-panopticon.lua " .. sendArgs) |
625 | if testing("Integrity") or testing("Updated") then checkExes(downloadLock) end | 625 | if testing("Integrity") or testing("Updated") then checkExes(downloadLock) end |
626 | end | 626 | end |
627 | end | 627 | end |
628 | while 1 <= checkExes("mirror-checker.lua " .. sendArgs) do os.execute("sleep 10") end | 628 | while 1 <= checkExes("apt-panopticon.lua " .. sendArgs) do os.execute("sleep 10") end |
629 | if testing("Integrity") or testing("Updated") then | 629 | if testing("Integrity") or testing("Updated") then |
630 | while 0 < checkExes(downloadLock) do os.execute("sleep 10") end | 630 | while 0 < checkExes(downloadLock) do os.execute("sleep 10") end |
631 | end | 631 | end |