Skip to content

Commit

Permalink
Merge pull request #1 from doron1/patch-1
Browse files Browse the repository at this point in the history
Adapt spin down/up detection to Unraid ge 6.9.0 and SAS
  • Loading branch information
Squidly271 authored Feb 16, 2021
2 parents d176286 + d12c352 commit 94f9334
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,19 @@ function getDisks() {
$validDisks = getDisks();
$totalSpunDown = 0;
foreach ($validDisks as $disk) {
$result = shell_exec("hdparm -C /dev/{$disk['device']}");
if ( $debug ) {
logger($result);
}
if ( ! strpos($result,"active") ) {
$totalSpunDown++;
if ( file_exists("/usr/local/sbin/sdspin") ) {
exec("/usr/local/sbin/sdspin /dev/{$disk['device']}",$out,$ret);
if ( $ret == 2 ) {
$totalSpunDown++;
}
} else {
$result = shell_exec("hdparm -C /dev/{$disk['device']}");
if ( $debug ) {
logger($result);
}
if ( ! strpos($result,"active") ) {
$totalSpunDown++;
}
}
}
if ( $debug ) {
Expand Down Expand Up @@ -123,4 +130,4 @@ function getDisks() {
@unlink($turboPaths['backgroundPID']);
@unlink($turboPaths['status']);

?>
?>

0 comments on commit 94f9334

Please sign in to comment.