controller: Make action shell command local

This commit is contained in:
patrick96 2020-05-31 21:13:12 +02:00 committed by Patrick Ziegler
parent 9fb75779f3
commit 41ffc3607d
2 changed files with 4 additions and 9 deletions
src/components

View file

@ -567,15 +567,11 @@ void controller::process_inputdata() {
// Run input as command if it's not an input for a module
m_log.info("Forwarding command to shell... (input: %s)", cmd);
if (m_command) {
m_log.warn("Terminating previous shell command");
m_command->terminate();
}
m_log.info("Executing shell command: %s", cmd);
m_command = command_util::make_command<output_policy::IGNORED>(move(cmd));
m_command->exec();
m_command.reset();
auto shell_cmd = command_util::make_command<output_policy::IGNORED>(move(cmd));
shell_cmd->exec();
shell_cmd.reset();
process_update(true);
} catch (const application_error& err) {
m_log.err("controller: Error while forwarding input to shell -> %s", err.what());