More SMART fixes for unassigned devices

This commit is contained in:
bergware
2017-12-24 19:20:50 +01:00
parent bc6f0d85f6
commit 90a34421cd

View File

@@ -16,11 +16,18 @@ Cond="strpos($disks[$name]['status'],'_NP')===false"
*/
?>
<?
$date = date('Ymd-Hi');
$dev = $dev ?? $name;
$date = $date ?? date('Ymd-Hi');
$live = exec("hdparm -C ".escapeshellarg("/dev/$dev")."|grep -Pom1 'active|unknown'");
$zip = str_replace(' ','_',strtolower($var['NAME']))."-smart-$date.zip";
// deal with unassigned devices
if (!$dev) {
$dev = $name;
foreach ($devs as $disk) {
if ($disk['device']==$name) {$file = $disk['id']."-$date.txt"; break;}
}
}
function spindownDelay() {
global $spindown, $delay;
$tmp = "/var/tmp/$spindown";