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 <miciu@gmx.de>
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
This commit is contained in:
Michael Unterkalmsteiner 2009-11-11 20:57:29 +01:00 committed by Adrian C. (anrxc)
parent 249294551e
commit 1790abb0ed
1 changed files with 1 additions and 1 deletions

View File

@ -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)