helpers: remove hardcoded path

Origin commit data
------------------
Commit: cc3b296ebb
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-12-10 (Thu, 10 Dec 2020)

Origin message was:
------------------
- helpers: remove hardcoded path
This commit is contained in:
vanhofen
2020-12-10 21:44:19 +01:00
parent b2b6942d37
commit 87c875fcbd

View File

@@ -114,8 +114,10 @@ void wakeup_hdd(const char *hdd_dir, bool msg)
msg = false;
if (msg)
loadBox.paint();
std::string s = check_var("/bin/wakeup.sh");
my_system(2,s.c_str(),hdd_dir);
std::string wakeup_sh = find_executable("wakeup.sh");
if (!wakeup_sh.empty())
my_system(2, wakeup_sh.c_str(), hdd_dir);
if (!g_settings.hdd_wakeup) {
printf("[hdd] internal wakeup disabled\n");
@@ -147,6 +149,7 @@ void wakeup_hdd(const char *hdd_dir, bool msg)
if (msg)
loadBox.hide();
}
//use for script with full path
int my_system(const char * cmd)
{