This commit is contained in:
@ -111,25 +111,22 @@ int edit_config()
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
int edit_server(const std::string &server_name)
|
||||
{
|
||||
std::string serverpath = localpath::server(server_name);
|
||||
if (serverpath.empty()) {
|
||||
if (localpath::server(server_name).empty()) {
|
||||
std::cerr << "Error: Server not found: " << server_name << std::endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::ostringstream aftertext;
|
||||
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 = localfile::server_json(server_name);
|
||||
|
||||
std::string config_file = serverpath + "/server.env";
|
||||
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 << "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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user