dropshell release 2025.0513.2220
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled

This commit is contained in:
Your Name
2025-05-13 22:20:16 +12:00
parent 89095cdc50
commit 97776b4642
7 changed files with 51 additions and 31 deletions

View File

@@ -102,8 +102,6 @@ int edit_config()
gConfig().save_config(true);
// make sure we have executables.
std::cout << "Successfully edited config file at " << config_file << std::endl;
return 0;
}

View File

@@ -243,14 +243,49 @@ namespace dropshell
return -1;
}
int install_local_agent()
{
std::vector<std::filesystem::path> paths = {
gConfig().get_local_template_cache_path(),
gConfig().get_local_backup_path(),
gConfig().get_local_tempfiles_path(),
localpath::agent()
};
for (auto &p : gConfig().get_local_server_definition_paths())
paths.push_back(p);
for (auto &p : paths)
if (!std::filesystem::exists(p))
{
std::cout << "Creating directory: " << p << std::endl;
std::filesystem::create_directories(p);
}
// download bb64.
if (!std::filesystem::exists(localpath::agent()+"bb64"))
{
std::string cmd = "cd " + localpath::agent() + " && curl -fsSL -o bb64 https://gitea.jde.nz/public/bb64/releases/download/latest/bb64.amd64 && chmod a+x bb64";
int ret = system(cmd.c_str());
if (EXITSTATUSCHECK(ret))
std::cout << "Downloaded bb64 to " << localpath::agent() << std::endl;
else
std::cerr << "Failed to download bb64 to " << localpath::agent() << std::endl;
} else
system((localpath::agent()+"bb64 -u").c_str()); // update.
}
int install_host()
{
// update dropshell.
// install the local dropshell agent.
return update_dropshell();
int rval = update_dropshell();
if (rval != 0)
return rval;
rval = install_local_agent();
if (rval != 0)
return rval;
}