This commit is contained in:
@ -298,10 +298,12 @@ namespace dropshell
|
||||
|
||||
// now create the agent.
|
||||
// copy across from the local agent files.
|
||||
std::cout << "Copying local agent files to remote server... " << std::flush;
|
||||
shared_commands::rsync_tree_to_remote(localpath::files_for_remote_agent(), agent_path, server_env, false);
|
||||
std::cout << "done." << std::endl;
|
||||
|
||||
// add in bb64. We can't use execute_remote_command() here, as that relies on bb64 which we're installing!
|
||||
std::cout << "Installing bb64 on " << server << std::endl << std::flush;
|
||||
std::cout << "Installing bb64 on " << server << "..." << std::endl << std::flush;
|
||||
|
||||
std::string remote_cmd =
|
||||
"ssh -p " + server_env.get_SSH_INFO().port + " " + server_env.get_SSH_INFO().user + "@" + server_env.get_SSH_INFO().host +
|
||||
@ -315,11 +317,14 @@ namespace dropshell
|
||||
std::cout << "Downloaded bb64 to " << agent_path << " on remote server." << std::endl;
|
||||
|
||||
// just test all is ok
|
||||
|
||||
// run the self-test.
|
||||
std::string output;
|
||||
bool okay = execute_ssh_command(server_env.get_SSH_INFO(), sCommand(agent_path, "./bb64 -i VGhlIGRyb3BzaGVsbCByZW1vdGUgYWdlbnQgaXMgY29ycmVjdGx5IGluc3RhbGxlZC4=", {}), cMode::CaptureOutput, &output);
|
||||
bool okay = execute_ssh_command(server_env.get_SSH_INFO(), sCommand(agent_path, "./selftest.sh", {}), cMode::Defaults, &output);
|
||||
if (!okay)
|
||||
{
|
||||
std::cerr << "Failed to install bb64 on " << server << std::endl;
|
||||
std::cerr << "ERROR: Failed to install remote agent on " << server << std::endl;
|
||||
std::cerr << "ERROR: Output: " << output << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user