From 8cc61ae50d261283553855f27b471bbf123d2a53 Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 2 Jan 2020 14:25:33 +1000 Subject: Forgot a couple things in the last commit. --- apt-panopticon.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 4981ad3..8f953d0 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -955,10 +955,12 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. local num = '[%d%.]+[kM]?' if APT.checkFile(f) then for l in io.lines(f) do - 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..')') + local speed, crrnt = l:match('^%c *'..num..' +'..num..' +%d+ +'..num..' +%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 + if 'M' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000000' end + if 'M' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000000' end speed = tonumber(speed) crrnt = tonumber(crrnt) if speed < min and speed ~= 0 then min = speed end -- cgit v1.1