From efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 2 Jan 2020 14:06:23 +1000 Subject: Maybe fix the missing speeds. --- apt-panopticon.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index da9e4cc..4981ad3 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -952,9 +952,10 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. curl: (22) The requested URL returned error: 404 Not Found ]] local min, max, spd = 999999999999, 0 + local num = '[%d%.]+[kM]?' if APT.checkFile(f) then for l in io.lines(f) do - local speed, crrnt = l:match('^%c *%d+ +%d+k? +%d+ +%d+k? +%d+ +%d+ +(%d+k?) +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +(%d+k?)') + local speed, crrnt = l:match('^%c *'..num..' +'..num..' +%d+ +%d+[kM]? +%d+ +%d+ +('..num..') +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +('..num..')') if nil ~= speed then if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end if 'k' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000' end -- cgit v1.1