diff --git a/source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/scripts/auto_turbo.php b/source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/scripts/auto_turbo.php index 0b8ddc4..0d007a0 100644 --- a/source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/scripts/auto_turbo.php +++ b/source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/scripts/auto_turbo.php @@ -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 ) { @@ -123,4 +130,4 @@ function getDisks() { @unlink($turboPaths['backgroundPID']); @unlink($turboPaths['status']); -?> \ No newline at end of file +?>