diff options
| -rwxr-xr-x | apt-panopticon.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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. | |||
| 952 | curl: (22) The requested URL returned error: 404 Not Found | 952 | curl: (22) The requested URL returned error: 404 Not Found |
| 953 | ]] | 953 | ]] |
| 954 | local min, max, spd = 999999999999, 0 | 954 | local min, max, spd = 999999999999, 0 |
| 955 | local num = '[%d%.]+[kM]?' | ||
| 955 | if APT.checkFile(f) then | 956 | if APT.checkFile(f) then |
| 956 | for l in io.lines(f) do | 957 | for l in io.lines(f) do |
| 957 | 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?)') | 958 | 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..')') |
| 958 | if nil ~= speed then | 959 | if nil ~= speed then |
| 959 | if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end | 960 | if 'k' == speed:sub(-1, -1) then speed = speed:sub(1, -2) .. '000' end |
| 960 | if 'k' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000' end | 961 | if 'k' == crrnt:sub(-1, -1) then crrnt = crrnt:sub(1, -2) .. '000' end |
