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