This commit is contained in:
@ -289,11 +289,6 @@ std::map<std::string, ServiceStatus> service_runner::get_all_services_status(std
|
||||
std::string command = "_allservicesstatus";
|
||||
std::string service_name = "dropshell-agent";
|
||||
|
||||
if (!gTemplateManager().template_command_exists(service_name, command))
|
||||
{
|
||||
std::cerr << "Error: " << service_name << " does not contain the " << command << " script" << std::endl;
|
||||
return status;
|
||||
}
|
||||
|
||||
server_env_manager env(server_name);
|
||||
if (!env.is_valid()) {
|
||||
@ -301,8 +296,14 @@ std::map<std::string, ServiceStatus> service_runner::get_all_services_status(std
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
std::string remote_service_template_path = remotepath::service_template(server_name,service_name);
|
||||
std::string script_path = remote_service_template_path + "/shared/" + command + ".sh";
|
||||
sCommand scommand(remote_service_template_path, "bash " + quote(script_path), {});
|
||||
|
||||
std::string output;
|
||||
if (!env.run_remote_template_command_and_capture_output(service_name, command, {}, output, true, {}))
|
||||
cMode mode = cMode::CaptureOutput | cMode::RawCommand;
|
||||
if (!execute_ssh_command(env.get_SSH_INFO(), scommand, mode, &output))
|
||||
return status;
|
||||
|
||||
std::stringstream ss(output);
|
||||
|
Reference in New Issue
Block a user