From cc182c9f8a6eef6be66f99de4fbfe098a6c83936 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 2 Jan 2020 18:43:36 +1000 Subject: Collate more data from the redirect results. A few too many bandaids, gonna have to rewrite some stuff soonish. --- apt-panopticommon.lua | 5 ++++- apt-panopticon.lua | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index 7664297..ffc3af4 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -671,6 +671,7 @@ APT.collateAll = function(hosts, l, host, func) results = loadfile(f)() results = APT.padResults(results) if nil ~= func then func(results) end + results = APT.collate(l, host, 'R', results) local v = hosts[host] if nil ~= v then local IPs = results.IPs @@ -679,16 +680,18 @@ APT.collateAll = function(hosts, l, host, func) if "table" == type(u) then for h, t in pairs(u) do results = APT.collate(l, host, h, results) + results = APT.collate(l, host, h .. '_R', results) if nil ~= func then func(results, h) end end else - results = APT.collate(l, host, i, results) + results = APT.collate(l, host, i .. '_R', results) if nil ~= func then func(results, i) end end end end end end + results = APT.padResults(results) return results end diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 52e11eb..6558474 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -1127,7 +1127,8 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. local srvs = io.popen('ls -1 results/*.lua') for l in srvs:lines() do local hst = l:sub(9, -5) - if (l:find('_') == nil) and (nil == APT.mirrors[hst]) then + if nil ~= l:find('_R%.lua') then hst = hst:sub(1, -3) end + if (hst:find('_') == nil) and (nil == APT.mirrors[hst]) then local ips = loadfile(l)().IPs if nil ~= ips then debians[hst] = {Country = '', FDQN = hst, Active = 'yes', Rate = '', BaseURL = hst, Protocols = {http = true, https = true}, Bandwidth = '', IPs = ips} -- cgit v1.1