From 09b4acd110db1526eb8573da9342e59ab4b72928 Mon Sep 17 00:00:00 2001 From: "Bastian (BaM)" Date: Sun, 14 Sep 2025 12:45:44 +0200 Subject: [PATCH] Ensure .ssh directory exists before creating SSH identity file --- scripts/auto-boot-ollama-host.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/auto-boot-ollama-host.lua b/scripts/auto-boot-ollama-host.lua index 11fecec..c287ba6 100644 --- a/scripts/auto-boot-ollama-host.lua +++ b/scripts/auto-boot-ollama-host.lua @@ -82,6 +82,12 @@ local function createSSHKeyFilesFromEnv() return end + -- Ensure .ssh directory exists + local ssh_dir = SSH_IDENTITY_FILE:match("^(.*)/[^/]+$ + if ssh_dir then + os.execute(("mkdir -p %q && chmod 700 %q"):format(ssh_dir, ssh_dir)) + end + local priv_fh = io.open(SSH_IDENTITY_FILE, "w") if not priv_fh then log("Failed to open SSH identity file for writing: " .. SSH_IDENTITY_FILE)