From e44e1f3a32c4f739ed2f3dd94be5695ec9003f3c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 10 Dec 2020 21:44:19 +0100 Subject: [PATCH] network-service: remove hardcoded paths Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dae578f3d6d3d63fa6dea0cd9207187302b18108 Author: vanhofen Date: 2020-12-10 (Thu, 10 Dec 2020) Origin message was: ------------------ - network-service: remove hardcoded paths ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/network_service.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/network_service.cpp b/src/gui/network_service.cpp index fb0b9d547..81f5a49e1 100644 --- a/src/gui/network_service.cpp +++ b/src/gui/network_service.cpp @@ -176,12 +176,8 @@ int CNetworkServiceSetup::showNetworkServiceSetup() items[i] = new CNetworkService(services[i].cmd, services[i].options); services[i].enabled = items[i]->Enabled(); - std::string execute1 = "/bin/" + services[i].cmd; - std::string execute2 = "/sbin/" + services[i].cmd; - - active = false; - if ( !(access(execute1, F_OK)) || !(access(execute2, F_OK)) ) - active = true; + std::string exec = find_executable(services[i].cmd.c_str()); + active = !exec.empty(); if ( (services[i].name == "Telnet") && useinetd) active = false;