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:
parent
249294551e
commit
1790abb0ed
|
@ -25,7 +25,7 @@ local function worker(format, port)
|
||||||
local hdd_temp = {}
|
local hdd_temp = {}
|
||||||
|
|
||||||
for line in f:lines() do
|
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
|
if disk ~= nil and temp ~= nil then
|
||||||
hdd_temp["{"..disk.."}"] = tonumber(temp)
|
hdd_temp["{"..disk.."}"] = tonumber(temp)
|
||||||
|
|
Loading…
Reference in New Issue