From 87c875fcbde3c04714f3a5a2e6b7a09cd111d440 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 10 Dec 2020 21:44:19 +0100 Subject: [PATCH] helpers: remove hardcoded path Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc3b296ebba28f4fd1f619b30f3dddee32ab0c58 Author: vanhofen Date: 2020-12-10 (Thu, 10 Dec 2020) Origin message was: ------------------ - helpers: remove hardcoded path --- src/system/helpers.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 026fdcae9..0ebf7629e 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -110,16 +110,18 @@ void wakeup_hdd(const char *hdd_dir, bool msg) //NI CHintBox loadBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_HDD_WAKEUP_START)); - if(!g_settings.hdd_wakeup_msg) + if (!g_settings.hdd_wakeup_msg) msg = false; - if(msg) + 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"); - if(msg) + if (msg) loadBox.hide(); return; } @@ -144,9 +146,10 @@ void wakeup_hdd(const char *hdd_dir, bool msg) remove(wakeup_file.c_str()); } //NI - if(msg) + if (msg) loadBox.hide(); } + //use for script with full path int my_system(const char * cmd) {