Check for remote agent before service install
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 43s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m16s

This commit is contained in:
j
2026-04-03 15:58:39 +13:00
parent 2ad8718857
commit 7416288c71

View File

@@ -89,6 +89,17 @@ namespace dropshell
ASSERT(!remote_service_path.empty(), "Install_Service: Remote service path is empty for " + service + " on " + server); ASSERT(!remote_service_path.empty(), "Install_Service: Remote service path is empty for " + service + " on " + server);
ASSERT(!user.empty(), "Install_Service: User is empty for " + service + " on " + server); ASSERT(!user.empty(), "Install_Service: User is empty for " + service + " on " + server);
// Check if the remote agent is installed on the server
{
std::string agent_check_cmd = "test -f " + quote(remotepath(server, user).agent() + "/ds_install.sh");
if (!execute_ssh_command(server_env.get_SSH_INFO(user), sCommand("", agent_check_cmd, {}), cMode::Silent))
{
error << "Server '" << server << "' has not been initialized." << std::endl;
info << "Please run: dropshell install " << server << std::endl;
return false;
}
}
maketitle("Installing " + service + " (" + service_info.template_name + ") on " + server); maketitle("Installing " + service + " (" + service_info.template_name + ") on " + server);
// Pull latest template from git if applicable // Pull latest template from git if applicable