This commit is contained in:
parent
985153377f
commit
82af6a6af7
@ -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
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user