mirror of
https://github.com/unraid/webgui.git
synced 2026-05-02 07:49:20 -05:00
Revised SMART temperature reading logic
This commit is contained in:
@@ -256,7 +256,7 @@ foreach ($devs as $dev) {
|
||||
$type = $var['smType'] ?? '';
|
||||
$port = port_name($name);
|
||||
if (!file_exists($smart) || (time()-filectime($smart)>$var['poll_attributes'])) exec("smartctl -n standby -A $type ".escapeshellarg("/dev/$port")." >".escapeshellarg($smart));
|
||||
$temp = exec("awk 'BEGIN{t=\"*\"} \$1==190||\$1==194{t=\$10;exit};\$1==\"Temperature:\"{t=\$2;exit} END{print t}' ".escapeshellarg($smart)." 2>/dev/null");
|
||||
$temp = exec("awk 'BEGIN{s=t=\"*\"}\$1==190{s=\$10};\$1==194{t=\$10;exit};\$1==\"Temperature:\"{t=\$2;exit} END{if(t!=\"*\")print t; else print s}' ".escapeshellarg($smart)." 2>/dev/null");
|
||||
$text = "device $name";
|
||||
$info = !empty($dev['id']) ? "{$dev['id']} ($name)": "No device identification ($name)";
|
||||
// process disk temperature notifications
|
||||
|
||||
Reference in New Issue
Block a user