diff options
-rwxr-xr-x | mirror-checker.lua | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/mirror-checker.lua b/mirror-checker.lua index 142c5e3..197e6c1 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua | |||
@@ -257,29 +257,33 @@ forkIP = function (orig, host) | |||
257 | local ph = url.parse("http://" .. host, defaultURL) | 257 | local ph = url.parse("http://" .. host, defaultURL) |
258 | gatherIPs(ph.host) | 258 | gatherIPs(ph.host) |
259 | for k, v in pairs(IP[ph.host]) do | 259 | for k, v in pairs(IP[ph.host]) do |
260 | D("DNS record " .. v .. " " .. k .. " for " .. ph.host) | ||
260 | if v == "A" then | 261 | if v == "A" then |
261 | if testing("IPv4") then execute("sleep 1; ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. host .. " " .. k .. " &") end | 262 | if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. " " .. k .. " &") end |
262 | elseif v == "AAAA" then | 263 | elseif v == "AAAA" then |
263 | if testing("IPv6") then execute("sleep 1; ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. host .. " [" .. k .. "] &") end | 264 | if testing("IPv6") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. " [" .. k .. "] &") end |
264 | elseif v == "CNAME" then | 265 | elseif v == "CNAME" then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. k .. " &") |
265 | forkIP(orig, k) | 266 | forkIP(orig, k) -- Check the original as well as the CNAME, so they both get checked. |
266 | end | 267 | end |
267 | end | 268 | end |
268 | end | 269 | end |
269 | 270 | ||
270 | checkIP = function (orig, host, path, ip) | 271 | checkHost = function (orig, host, path, ip) |
272 | if nil == host then host = orig end | ||
273 | if nil == path then path = "" end | ||
271 | if nil ~= ip then | 274 | if nil ~= ip then |
272 | checkPaths(orig, ip, path) | 275 | checkPaths(orig, ip, path) |
273 | else | 276 | else |
274 | D("checkIP " .. orig .. " " .. host) | 277 | D("checkHost " .. orig .. " " .. host) |
275 | gatherIPs(host) | 278 | gatherIPs(host) |
276 | for k, v in pairs(IP[host]) do | 279 | for k, v in pairs(IP[host]) do |
280 | D("DNS record " .. v .. " " .. k .. " for " .. host) | ||
277 | if v == "A" then | 281 | if v == "A" then |
278 | if testing("IPv4") then checkPaths(orig, k, path) end | 282 | if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " " .. k .. " &") end |
279 | elseif v == "AAAA" then | 283 | elseif v == "AAAA" then |
280 | if testing("IPv6") then checkPaths(orig, "[" .. k .. "]", path) end | 284 | if testing("IPv6") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " [" .. k .. "] &") end |
281 | elseif v == "CNAME" then | 285 | elseif v == "CNAME" then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. k .. path .. " &") |
282 | checkIP(orig, k, path) | 286 | checkHost(orig, k, path) -- Check the original, with the DNS records from the CNAME, as well as the CNAME, so they both get checked. |
283 | end | 287 | end |
284 | end | 288 | end |
285 | end | 289 | end |