aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon.lua
diff options
context:
space:
mode:
authoronefang2020-01-02 14:06:23 +1000
committeronefang2020-01-02 14:06:23 +1000
commitefd9a4be2a67cb4da2ff98ada6af44ba92be3ffc (patch)
treef6d93cea5b03371a1b1bbc6c16bf2c5c90e58f72 /apt-panopticon.lua
parentFix missing speeds, this time for sure. (diff)
downloadapt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.zip
apt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.tar.gz
apt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.tar.bz2
apt-panopticon-efd9a4be2a67cb4da2ff98ada6af44ba92be3ffc.tar.xz
Maybe fix the missing speeds.
Diffstat (limited to 'apt-panopticon.lua')
-rwxr-xr-xapt-panopticon.lua3
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