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,11 +215,15 @@ 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"}
if ok then for _,lname in ipairs(names) do
-- print update crontab local ok, mod = pcall(require, lname)
crontab = mod if ok then
return true -- print update crontab
log('Debug', "Using crontab: "..lname)
crontab = mod
return true
end
end end
return false return false
end end