mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
helpers: add function to execute control scripts
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7882ee4805
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-01-26 (Sat, 26 Jan 2019)
Origin message was:
------------------
- helpers: add function to execute control scripts
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -527,6 +527,20 @@ std::string find_executable(const char *name)
|
||||
return "";
|
||||
}
|
||||
|
||||
bool exec_controlscript(std::string script)
|
||||
{
|
||||
std::string controlscript = (std::string)CONTROLDIR + "/" + script;
|
||||
if (access((std::string)CONTROLDIR_VAR + "/" + script.c_str(), X_OK) == 0)
|
||||
controlscript = (std::string)CONTROLDIR_VAR + "/" + script;
|
||||
|
||||
dprintf(DEBUG_NORMAL, "executing %s\n", controlscript.c_str());
|
||||
int ret = my_system(controlscript.c_str());
|
||||
if (ret)
|
||||
dprintf(DEBUG_NORMAL, "control script failed\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string backtick(std::string command)
|
||||
{
|
||||
char *buf = NULL;
|
||||
|
Reference in New Issue
Block a user