From bbd7c635a8e12573fa49bd1030a00ddb5012b929 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 4 May 2025 22:35:51 +1200 Subject: [PATCH] Update scripts. --- src/servers.cpp | 7 +++++++ src/service_runner.cpp | 2 +- src/services.cpp | 4 ++-- templates/caddy/logs.sh | 4 ++-- templates/caddy/start.sh | 2 +- templates/example-nginx/config/service.env | 4 ++-- templates/example-nginx/install.sh | 4 ---- templates/example-nginx/start.sh | 2 +- templates/simple-object-storage/start.sh | 2 +- templates/watchtower/install.sh | 4 ---- templates/watchtower/logs.sh | 4 ---- templates/watchtower/start.sh | 4 ---- templates/watchtower/status.sh | 4 ---- templates/watchtower/stop.sh | 4 ---- templates/watchtower/uninstall.sh | 4 ---- 15 files changed, 17 insertions(+), 38 deletions(-) diff --git a/src/servers.cpp b/src/servers.cpp index 976060c..103631e 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -78,6 +78,9 @@ void list_servers() { tableprint tp("All DropShell Servers"); tp.add_row({"Name", "User", "Address", "Health", "Ports"}); + std::cout << "Checking "< status = service_runner::get_all_services_status(server.name); @@ -93,8 +96,12 @@ void list_servers() { ports_used_str += std::to_string(port) + " "; tp.add_row({server.name, server.ssh_user, server.ssh_host, serviceticks, ports_used_str}); + ++checked; + // print out a tick character for each server checked. + std::cout << checked << " ✓ " << std::flush; }); task->wait(); + std::cout << std::endl << std::endl; tp.print(); } diff --git a/src/service_runner.cpp b/src/service_runner.cpp index 777211e..9197c24 100644 --- a/src/service_runner.cpp +++ b/src/service_runner.cpp @@ -79,7 +79,7 @@ bool service_runner::install() { } } - // Copy service files (including service.env) + // Copy service files { std::string local_service_path = localpath::service(mServer,mService); if (local_service_path.empty() || !fs::exists(local_service_path)) { diff --git a/src/services.cpp b/src/services.cpp index 4aaa973..43860e7 100644 --- a/src/services.cpp +++ b/src/services.cpp @@ -66,7 +66,7 @@ LocalServiceInfo get_service_info(const std::string &server_name, const std::str std::map variables; get_all_service_env_vars(server_name, service_name, variables); - // load the service.env file + // confirm TEMPLATE is defined. auto it = variables.find("TEMPLATE"); if (it == variables.end()) { std::cerr << "Error: TEMPLATE variable not defined in service " << service_name << " on server " << server_name << std::endl; @@ -199,7 +199,7 @@ bool create_service(const std::string &server_name, const std::string &template_ std::cout << "Service " << service_name <<" created successfully"<