Tidy ssh commands

This commit is contained in:
John
2025-04-27 09:43:02 +12:00
parent c6665f3044
commit e3e8e5f7d3
3 changed files with 16 additions and 10 deletions

View File

@ -217,11 +217,9 @@ std::map<std::string, ServiceStatus> service_runner::get_all_services_status(std
}
std::string script_path = remote_service_template_path + "/" + command + ".sh";
std::string ssh_cmd = env.construct_ssh_cmd() + "'cd " + quote(remote_service_template_path) +
" && /bin/bash "+quote(script_path)+" "+quote(remote_service_config_path)+"'";
std::string output;
if (!env.execute_local_command_and_capture_output(ssh_cmd, output))
if (!env.execute_ssh_command_and_capture_output("'cd " + quote(remote_service_template_path) +
" && /bin/bash "+quote(script_path)+"'", output))
return status;
std::stringstream ss(output);