01.05.2019, 19:47
Hi.
You can use this script to get your function.
-- Enables / Disables schedulers
name = 'Scheduler 1'
active = event.getvalue()
db:update('schedulers', { active = toboolean(active) }, { name = name })
clearschedulers()
--------------end---------------------
--------------put this in common functions---------------------
function clearschedulers()
local files = io.ls('/tmp')
for _, file in ipairs(files) do
if file:find('lm-scheduler-', 1, true) then
os.remove('/tmp/' .. file)
end
end
end
---------------------end-------------------------------------------
You can use this script to get your function.
-- Enables / Disables schedulers
name = 'Scheduler 1'
active = event.getvalue()
db:update('schedulers', { active = toboolean(active) }, { name = name })
clearschedulers()
--------------end---------------------
--------------put this in common functions---------------------
function clearschedulers()
local files = io.ls('/tmp')
for _, file in ipairs(files) do
if file:find('lm-scheduler-', 1, true) then
os.remove('/tmp/' .. file)
end
end
end
---------------------end-------------------------------------------