The regular expression did not match the following output from hddtemp:

|/dev/sg0|ST9160823ASG|38|C||/dev/sda|ST9160823ASG|38|C|

Fixed by allowing digits in the "disk" part of the expression.

Signed-off-by: Michael Unterkalmsteiner <[email protected]>
---
 hddtemp.lua |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hddtemp.lua b/hddtemp.lua
index fe516e8..b242e4a 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/%a%d]+)|.*|([%d]+)|[CF]+|")
 
         if disk ~= nil and temp ~= nil then
             hdd_temp["{"..disk.."}"] = tonumber(temp)
-- 
1.6.3.3


-- 
To unsubscribe, send mail to [email protected].

Reply via email to