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

View File

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