mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-11-16 10:05:12 +00:00
Search crontab library with different names
This commit is contained in:
parent
1eb8a83500
commit
e08685cfd6
14
lsyncd.lua
14
lsyncd.lua
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user