mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
gui/hdd_menu: use hd-idle instead of hdparm, if available
Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>
This commit is contained in:
@@ -271,6 +271,24 @@ int CHDDDestExec::exec(CMenuTarget* /*parent*/, const std::string&)
|
||||
if (n < 0)
|
||||
return 0;
|
||||
|
||||
if (!access("/sbin/hd-idle", X_OK)) {
|
||||
system("kill $(pidof hd-idle)");
|
||||
int sleep_seconds = g_settings.hdd_sleep;
|
||||
switch (sleep_seconds) {
|
||||
case 241:
|
||||
sleep_seconds = 30 * 60;
|
||||
break;
|
||||
case 242:
|
||||
sleep_seconds = 60 * 60;
|
||||
break;
|
||||
default:
|
||||
sleep_seconds *= 5;
|
||||
}
|
||||
if (sleep_seconds)
|
||||
my_system(3, "/sbin/hd-idle", "-i", to_string(sleep_seconds).c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char hdparm[] = "/sbin/hdparm";
|
||||
bool hdparm_link = false;
|
||||
struct stat stat_buf;
|
||||
|
Reference in New Issue
Block a user