19 lines
426 B
Lua
19 lines
426 B
Lua
-- 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
|