Search crontab library with different names

This commit is contained in:
Daniel Poelzleithner 2022-10-28 14:08:00 +02:00
parent 1eb8a83500
commit e08685cfd6
1 changed files with 9 additions and 5 deletions

View File

@ -215,12 +215,16 @@ local processCount = 0
local crontab = nil local crontab = nil
local function loadCrontab() local function loadCrontab()
local ok, mod = pcall(require, "lua-crontab") local names = {"crontab.crontab", "crontab", "lua-crontab"}
for _,lname in ipairs(names) do
local ok, mod = pcall(require, lname)
if ok then if ok then
-- print update crontab -- print update crontab
log('Debug', "Using crontab: "..lname)
crontab = mod crontab = mod
return true return true
end end
end
return false return false
end end