From 535fadbf5f1c0fa8462ac5343a0068e961334477 Mon Sep 17 00:00:00 2001 From: "Bastian (BaM)" Date: Sun, 14 Sep 2025 14:29:54 +0200 Subject: [PATCH] Fix SSH command execution by appending '&& true' to ensure proper handling of command success --- scripts/auto-boot-ollama-host.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/auto-boot-ollama-host.lua b/scripts/auto-boot-ollama-host.lua index 9a9c9bd..7b7c9db 100644 --- a/scripts/auto-boot-ollama-host.lua +++ b/scripts/auto-boot-ollama-host.lua @@ -180,7 +180,7 @@ local function main() if port_is_up(OLLAMA_HOST, SSH_PORT, 60) then log("SSH is reachable. Starting ollama service...") socket.sleep(2) - ssh("wsl.exe -d Debian -- 'sudo systemctl enable ollama && sudo systemctl start ollama'", "micro", OLLAMA_HOST, SSH_PORT, SSH_IDENTITY_FILE) + ssh("wsl.exe -d Debian -- 'sudo systemctl enable ollama && sudo systemctl start ollama' && true ", "micro", OLLAMA_HOST, SSH_PORT, SSH_IDENTITY_FILE) if (port_is_up(OLLAMA_HOST, OLLAMA_PORT, 90)) then log("Ollama service is reachable again.") socket.sleep(30) @@ -194,7 +194,7 @@ local function main() if line:find(FINISH_PATTERN, 1, true) ~= nil and powered_on == true then log(("Detected finish pattern: %q"):format(FINISH_PATTERN)) log("Shutting down Ollama host to save power...") - ssh("wsl.exe -d Debian -- 'sudo systemctl disable ollama && sudo systemctl stop ollama'", "micro", OLLAMA_HOST, SSH_PORT, SSH_IDENTITY_FILE) + ssh("wsl.exe -d Debian -- 'sudo systemctl disable ollama && sudo systemctl stop ollama' && true ", "micro", OLLAMA_HOST, SSH_PORT, SSH_IDENTITY_FILE) ssh("shutdown.exe /s /t 0", "micro", OLLAMA_HOST, SSH_PORT, SSH_IDENTITY_FILE) socket.sleep(5) powered_on = false