diff options
| author | onefang | 2020-01-02 14:06:23 +1000 |
|---|---|---|
| committer | onefang | 2020-01-02 14:06:23 +1000 |
| commit | efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc (patch) | |
| tree | f6d93cea5b03371a1b1bbc6c16bf2c5c90e58f72 | |
| parent | Fix missing speeds, this time for sure. (diff) | |
| download | apt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.zip apt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.tar.gz apt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.tar.bz2 apt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.tar.xz | |
Maybe fix the missing speeds.
| -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 |
