From 1da7dc79512f46114a0a2171e7a072531b79620c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Jun 2025 17:53:06 +1200 Subject: [PATCH] dropshell release 2025.0601.1752 --- source/agent-remote/common.sh | 2 ++ source/src/commands/install.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/agent-remote/common.sh b/source/agent-remote/common.sh index 56abeef..a93815f 100755 --- a/source/agent-remote/common.sh +++ b/source/agent-remote/common.sh @@ -93,6 +93,7 @@ _check_docker_installed() { # Checks if a container (any state) exists. Returns 1 if not found. _is_container_exists() { + [ -n "${1:-}" ] || { echo "_is_container_exists: Container name is empty" >&2; return 1; } if ! docker ps -a --format "{{.Names}}" | grep -q "^$1$"; then return 1 fi @@ -101,6 +102,7 @@ _is_container_exists() { # Checks if a container is currently running. Returns 1 if not running. _is_container_running() { + [ -n "${1:-}" ] || { echo "_is_container_running: Container name is empty" >&2; return 1; } if ! docker ps --format "{{.Names}}" | grep -q "^$1$"; then return 1 fi diff --git a/source/src/commands/install.cpp b/source/src/commands/install.cpp index 4f40ad8..da772d5 100644 --- a/source/src/commands/install.cpp +++ b/source/src/commands/install.cpp @@ -78,10 +78,13 @@ namespace dropshell if (!server_env.is_valid()) return false; // should never hit this. - - std::string user = server_env.get_user_for_service(service); + + std::string user = service_info.user; std::string remote_service_path = remotepath(server,user).service(service); + ASSERT(!remote_service_path.empty(), "Install_Service: Remote service path is empty for " + service + " on " + server); + ASSERT(!user.empty(), "Install_Service: User is empty for " + service + " on " + server); + if (server_env.check_remote_dir_exists(remote_service_path, user)) { // uninstall the old service before we update the config or template! info << "Service " << service << " is already installed on " << server << std::endl;