This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Schedule on/off
#2
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-------------------------------------------
Reply


Messages In This Thread
Schedule on/off - by BMA - 01.05.2019, 18:27
RE: Schedule on/off - by Rauschentofft - 01.05.2019, 19:47
RE: Schedule on/off - by BMA - 01.05.2019, 20:17
RE: Schedule on/off - by Rauschentofft - 02.05.2019, 05:39
RE: Schedule on/off - by BMA - 03.05.2019, 05:27

Forum Jump: