From 7416288c71df8300d6702736ff24ebb1bfc5ed16 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 3 Apr 2026 15:58:39 +1300 Subject: [PATCH] Check for remote agent before service install --- source/src/commands/install.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/src/commands/install.cpp b/source/src/commands/install.cpp index 32e2431..02f322e 100644 --- a/source/src/commands/install.cpp +++ b/source/src/commands/install.cpp @@ -89,6 +89,17 @@ namespace dropshell 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); + // 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); // Pull latest template from git if applicable