Working!
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled

This commit is contained in:
Your Name 2025-05-17 11:56:09 +12:00
parent 985153377f
commit 82af6a6af7
4 changed files with 405 additions and 1078 deletions

View File

@ -29,6 +29,9 @@ print_warning() {
echo -e "${YELLOW}[!] $1${NC}" echo -e "${YELLOW}[!] $1${NC}"
} }
# ensure we have latest dehydrate.
dehydrate -u
# Check if build directory exists, if not create it # Check if build directory exists, if not create it
if [ ! -d "build" ]; then if [ ! -d "build" ]; then
print_status "Creating build directory..." print_status "Creating build directory..."

File diff suppressed because it is too large Load Diff

View File

@ -111,25 +111,22 @@ int edit_config()
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
int edit_server(const std::string &server_name) int edit_server(const std::string &server_name)
{ {
std::string serverpath = localpath::server(server_name); if (localpath::server(server_name).empty()) {
if (serverpath.empty()) {
std::cerr << "Error: Server not found: " << server_name << std::endl; std::cerr << "Error: Server not found: " << server_name << std::endl;
return -1; return -1;
} }
std::ostringstream aftertext; std::string config_file = localfile::server_json(server_name);
aftertext << "If you have changed DROPSHELL_DIR, you should manually move the files to the new location NOW.\n"
<< "You can ssh in to the remote server with: dropshell ssh "<<server_name<<"\n"
<< "Once moved, reinstall all services with: dropshell install " << server_name;
std::string config_file = serverpath + "/server.env";
if (!edit_file(config_file, true)) { if (!edit_file(config_file, true)) {
std::cerr << "Error: Failed to edit server.env" << std::endl; std::cerr << "Error: Failed to edit server config" << std::endl;
std::cerr << "You can manually edit this file at: " << config_file << std::endl; std::cerr << "You can manually edit this file at: " << config_file << std::endl;
std::cerr << "After editing, " << aftertext.str() << std::endl; return 1;
} }
else
std::cout << aftertext.str() << std::endl; std::cout << "If you have changed DROPSHELL_DIR, you should manually move the files to the new location NOW." << std::endl
<< "You can ssh in to the remote server with: dropshell ssh "<<server_name<< std::endl
<< "Once moved, reinstall all services with: dropshell install " << server_name << std::endl;
return 0; return 0;
} }

View File

@ -182,7 +182,7 @@ std::map<std::string, ServiceStatus> service_runner::get_all_services_status(std
} }
std::string output; std::string output;
if (!execute_ssh_command(env.get_SSH_INFO(), sCommand(remotepath::agent(server_name), "_allservicesstatus.sh", {}), cMode::CaptureOutput, &output)) if (!execute_ssh_command(env.get_SSH_INFO(), sCommand(remotepath::agent(server_name), "./_allservicesstatus.sh", {}), cMode::CaptureOutput, &output))
return status; return status;
std::stringstream ss(output); std::stringstream ss(output);