Working on restore.

This commit is contained in:
John
2025-04-27 20:08:14 +12:00
parent 59561824c7
commit 8026070994
2 changed files with 13 additions and 10 deletions

View File

@ -134,19 +134,19 @@ int restore(const std::vector<std::string> &args)
}
{ // silently uninstalling the current service
std::cout << "2) Uninstalling current service..." << std::endl;
env.run_remote_template_command(service_name, "uninstall", {}, true);
env.run_remote_template_command(service_name, "uninstall", {}, false);
}
{ // restore service from backup
std::cout << "3) Restoring service from backup..." << std::endl;
env.run_remote_template_command(service_name, "restore", {local_backup_file_path}, true);
env.run_remote_template_command(service_name, "restore", {local_backup_file_path}, false);
}
// healthcheck the service
std::cout << "4) Healthchecking service..." << std::endl;
std::string green_tick = "\033[32m✓\033[0m";
std::string red_cross = "\033[31m✗\033[0m";
if (!env.run_remote_template_command(service_name, "status", {}, true))
if (env.run_remote_template_command(service_name, "status", {}, false))
std::cout << green_tick << " Service is healthy." << std::endl;
else
std::cout << red_cross << " Service is NOT healthy." << std::endl;