Improve responsiveness of unassigned devices

This commit is contained in:
bergware
2016-08-01 13:52:20 +02:00
parent 885d92bf43
commit 50d16d3ef1

View File

@@ -201,7 +201,7 @@ function read_disk(&$device, $item) {
return exec("hdparm -C /dev/$device|grep -Po active") ? 'blue-on' : 'blue-blink';
case 'temp':
$smart = "/var/local/emhttp/smart/$device";
if (!file_exists($smart) || (time()-filemtime($smart)>=$var['poll_attributes'])) exec("smartctl -n standby -A /dev/$device > $smart");
if (!file_exists($smart) || (time()-filemtime($smart)>=$var['poll_attributes'])) exec("smartctl -n standby -A /dev/$device >$smart &");
$temp = exec("awk '\$1==190||\$1==194{print \$10;exit}' $smart");
return $temp ? $temp : '*';
}