From 1790abb0eddaeb2c19017711f5d33e978d74b199 Mon Sep 17 00:00:00 2001 From: Michael Unterkalmsteiner Date: Wed, 11 Nov 2009 20:57:29 +0100 Subject: hddtemp: adapt regex to match disks like /dev/sg0 The regular expression did not match the following output from hddtemp: |/dev/sg0|ST9160823ASG|38|C|. Fixed by allowing digits in the "disk" part of the expression. Signed-off-by: Michael Unterkalmsteiner Signed-off-by: Adrian C. (anrxc) --- hddtemp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hddtemp.lua b/hddtemp.lua index fe516e8..a2557fa 100644 --- a/hddtemp.lua +++ b/hddtemp.lua @@ -25,7 +25,7 @@ local function worker(format, port) local hdd_temp = {} for line in f:lines() do - local disk, temp = string.match(line, "|([%/%a]+)|.*|([%d]+)|[CF]+|") + local disk, temp = string.match(line, "|([%/%a%d]+)|.*|([%d]+)|[CF]+|") if disk ~= nil and temp ~= nil then hdd_temp["{"..disk.."}"] = tonumber(temp) -- cgit v1.2.3