Browse Source

Ensure .ssh directory exists before creating SSH identity file

main
Bastian (BaM) 3 months ago
parent
commit
09b4acd110
  1. 6
      scripts/auto-boot-ollama-host.lua

6
scripts/auto-boot-ollama-host.lua

@ -82,6 +82,12 @@ local function createSSHKeyFilesFromEnv()
return return
end 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") local priv_fh = io.open(SSH_IDENTITY_FILE, "w")
if not priv_fh then if not priv_fh then
log("Failed to open SSH identity file for writing: " .. SSH_IDENTITY_FILE) log("Failed to open SSH identity file for writing: " .. SSH_IDENTITY_FILE)

Loading…
Cancel
Save