diff options
-rwxr-xr-x | mirror-checker.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/mirror-checker.lua b/mirror-checker.lua index cd95135..cf53b7f 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua | |||
@@ -52,6 +52,10 @@ local releaseFiles = | |||
52 | "-security/main/Contents-amd64.gz", | 52 | "-security/main/Contents-amd64.gz", |
53 | "-security/main/Contents-arm64.gz", | 53 | "-security/main/Contents-arm64.gz", |
54 | } | 54 | } |
55 | local notExist = | ||
56 | { | ||
57 | "ceres-security" -- This will never exist, it's our code name for the testing suite. | ||
58 | } | ||
55 | local referenceDebs = | 59 | local referenceDebs = |
56 | { | 60 | { |
57 | -- Devuan package. NOTE this one likely should not get redirected, but that's more a warning than an error. | 61 | -- Devuan package. NOTE this one likely should not get redirected, but that's more a warning than an error. |
@@ -131,6 +135,14 @@ local checkExes = function (exe) | |||
131 | return tonumber(count) | 135 | return tonumber(count) |
132 | end | 136 | end |
133 | 137 | ||
138 | local repoExists = function (r) | ||
139 | r = r:match("([%a-]*)") | ||
140 | if nil == r then return false end | ||
141 | for k, v in pairs(notExist) do | ||
142 | if v == r then return false end | ||
143 | end | ||
144 | return true | ||
145 | end | ||
134 | 146 | ||
135 | local IP = {} | 147 | local IP = {} |
136 | local gatherIPs = function (host) | 148 | local gatherIPs = function (host) |
@@ -208,6 +220,7 @@ local checkPaths = function (host, ip, path) | |||
208 | for j, k in pairs(releaseFiles) do | 220 | for j, k in pairs(releaseFiles) do |
209 | if testing("http") then checkURL(host, "http://" .. ip .. path .. "merged/dists/" .. s .. k) end | 221 | if testing("http") then checkURL(host, "http://" .. ip .. path .. "merged/dists/" .. s .. k) end |
210 | if testing("https") then checkURL(host, "https://" .. ip .. path .. "merged/dists/" .. s .. k) end | 222 | if testing("https") then checkURL(host, "https://" .. ip .. path .. "merged/dists/" .. s .. k) end |
223 | if repoExists(s .. k) then | ||
211 | end | 224 | end |
212 | end | 225 | end |
213 | end | 226 | end |
@@ -276,6 +289,8 @@ local downloads = function (host, URL, IP) | |||
276 | cm = "ionice -c3 " .. download .. log:format(s, s) | 289 | cm = "ionice -c3 " .. download .. log:format(s, s) |
277 | for j, k in pairs(releaseFiles) do | 290 | for j, k in pairs(releaseFiles) do |
278 | cm = cm .. " https://" .. host .. URL .. "/merged/dists/" .. s .. k | 291 | cm = cm .. " https://" .. host .. URL .. "/merged/dists/" .. s .. k |
292 | if repoExists(s .. k) then | ||
293 | end | ||
279 | end | 294 | end |
280 | end | 295 | end |
281 | execute(cm .. " &") | 296 | execute(cm .. " &") |