All fixed!

This commit is contained in:
John
2025-04-27 11:56:46 +12:00
parent 8c21260e49
commit 898cc97bae
2 changed files with 24 additions and 14 deletions

View File

@ -53,7 +53,7 @@ bool service_runner::install() {
std::string mkdir_cmd = "mkdir -p " + quote(mRemote_service_path);
if (!m_server_env.execute_ssh_command(mkdir_cmd))
{
std::cerr << "Failed to create service directory" << std::endl;
std::cerr << "Failed to create service directory " << mRemote_service_path << std::endl;
return false;
}
@ -221,21 +221,16 @@ std::map<std::string, ServiceStatus> service_runner::get_all_services_status(std
return status;
}
std::string remote_service_path = get_remote_service_path(server_name, service_name);
std::string remote_service_config_path = get_remote_service_config_path(server_name, service_name);
std::string remote_service_template_path = get_remote_service_template_path(server_name, service_name);
std::string remote_service_env_file = get_remote_service_env_file(server_name, service_name);
server_env env(server_name);
if (!env.is_valid()) {
std::cerr << "Error: Invalid server environment" << std::endl;
return status;
}
std::string script_path = remote_service_template_path + "/" + command + ".sh";
std::string remote_service_template_path = get_remote_service_template_path(server_name, service_name);
sCommand scommand(remote_service_template_path, "/bin/bash " + quote(remote_service_template_path + "/" + command + ".sh"), {});
std::string output;
if (!env.execute_ssh_command_and_capture_output("'cd " + quote(remote_service_template_path) +
" && /bin/bash "+quote(script_path)+"'", output))
if (!env.execute_ssh_command_and_capture_output(scommand, output))
return status;
std::stringstream ss(output);