diff options
-rwxr-xr-x | mirror-checker.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/mirror-checker.lua b/mirror-checker.lua index 86528f3..bba9d49 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua | |||
@@ -266,12 +266,6 @@ end | |||
266 | 266 | ||
267 | local checkHost = function (host, path, ip) | 267 | local checkHost = function (host, path, ip) |
268 | if nil == path then path = "/" else | 268 | if nil == path then path = "/" else |
269 | if "/" == path:sub(-1, -1) then | ||
270 | W("slash at end of BaseURL in mirror_list.txt! " .. host .. " " .. path) | ||
271 | else | ||
272 | path = path .. "/" | ||
273 | end | ||
274 | end | ||
275 | checkIP(host, host, path, ip) | 269 | checkIP(host, host, path, ip) |
276 | end | 270 | end |
277 | 271 | ||
@@ -396,6 +390,10 @@ end | |||
396 | execute("mkdir -p results") | 390 | execute("mkdir -p results") |
397 | 391 | ||
398 | if 0 < #arg then | 392 | if 0 < #arg then |
393 | if "/" == arg[1]:sub(-1, -1) then | ||
394 | W("slash at end of path! " .. arg[1]) | ||
395 | arg[1] = arg[1]:sub(1, -2) | ||
396 | end | ||
399 | local pu = url.parse("http://" .. arg[1], defaultURL) | 397 | local pu = url.parse("http://" .. arg[1], defaultURL) |
400 | if nil ~= arg[2] then | 398 | if nil ~= arg[2] then |
401 | logFile, e = io.open("results/mirror-checker-lua_" .. pu.host .. "_" .. arg[2] .. ".log", "a+") | 399 | logFile, e = io.open("results/mirror-checker-lua_" .. pu.host .. "_" .. arg[2] .. ".log", "a+") |
@@ -426,6 +424,10 @@ else | |||
426 | -- checkHost("deb.devuan.org") | 424 | -- checkHost("deb.devuan.org") |
427 | forkIP("deb.devuan.org") | 425 | forkIP("deb.devuan.org") |
428 | for k, m in pairs(mirrors) do | 426 | for k, m in pairs(mirrors) do |
427 | if "/" == m.BaseURL:sub(-1, -1) then | ||
428 | W("slash at end of BaseURL in mirror_list.txt! " .. m.BaseURL) | ||
429 | m.BaseURL = m.BaseURL:sub(1, -2) | ||
430 | end | ||
429 | local pu = url.parse("http://" .. m.BaseURL, defaultURL) | 431 | local pu = url.parse("http://" .. m.BaseURL, defaultURL) |
430 | -- checkHost(pu.host) | 432 | -- checkHost(pu.host) |
431 | forkIP(m.BaseURL) | 433 | forkIP(m.BaseURL) |