Refactor auto-boot-ollama-host script into modular structure with separate configuration, network, SSH, and service management modules for improved maintainability and readability

This commit is contained in:
Bastian (BaM)
2025-09-14 17:37:12 +02:00
parent 1442eb3df7
commit 149d8b2191
7 changed files with 340 additions and 174 deletions

18
scripts/utils.lua Normal file
View File

@@ -0,0 +1,18 @@
-- Utility functions module for auto-boot-ollama-host
-- Provides logging and other utility functions
local utils = {}
-- Logging function with timestamp
function utils.log(msg)
io.stdout:write(os.date("[%F %T] "), msg, "\n")
io.stdout:flush()
end
-- Get environment variable with default value
function utils.getenv(name, def)
local v = os.getenv(name)
return (v ~= nil and v ~= "") and v or def
end
return utils