diff options
Diffstat (limited to '')
-rwxr-xr-x | apt-panopticon.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 8f953d0..ea964ec 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
@@ -957,11 +957,13 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. | |||
957 | for l in io.lines(f) do | 957 | for l in io.lines(f) do |
958 | local speed, crrnt = l:match('^%c *'..num..' +'..num..' +%d+ +'..num..' +%d+ +%d+ +('..num..') +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +('..num..')') | 958 | local speed, crrnt = l:match('^%c *'..num..' +'..num..' +%d+ +'..num..' +%d+ +%d+ +('..num..') +%d+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +[%d%-]+:[%d%-]+:[%d%-]+ +('..num..')') |
959 | if nil ~= speed then | 959 | if nil ~= speed then |
960 | if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end | 960 | if 'k' == speed:sub(-1, -1) then speed = tonumber(speed:sub(1, -2)) * 1024 |
961 | if 'k' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000' end | 961 | elseif 'M' == speed:sub(-1, -1) then speed = tonumber(speed:sub(1, -2)) * 1024 * 1024 |
962 | if 'M' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000000' end | 962 | end |
963 | if 'M' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000000' end | ||
964 | speed = tonumber(speed) | 963 | speed = tonumber(speed) |
964 | if 'k' == crrnt:sub(-1, -1) then crrnt = tonumber(crrnt:sub(1, -2)) * 1024 | ||
965 | elseif 'M' == crrnt:sub(-1, -1) then crrnt = tonumber(crrnt:sub(1, -2)) * 1024 * 1024 | ||
966 | end | ||
965 | crrnt = tonumber(crrnt) | 967 | crrnt = tonumber(crrnt) |
966 | if speed < min and speed ~= 0 then min = speed end | 968 | if speed < min and speed ~= 0 then min = speed end |
967 | if speed > max then max = speed end | 969 | if speed > max then max = speed end |