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.

Wake up light
#12
Hi,

If you want to avoid a double instance of the script like admin adviced, add this code on top of your script:

Code:
storagename = 'wakeuplight_pid'
oldpid = storage.get(storagename)
pid = os.getpid()
storage.set(storagename, pid)  
if oldpid ~= nil then  
 os.kill(oldpid, signal.SIGKILL)
end

and put this at the end of the script:

Code:
storage.remove(storagename)

This code will check if there is already / still a instance running from a previous event and kill it.

BR,

Erwin
Reply


Messages In This Thread
Wake up light - by Mr.D - 05.04.2017, 07:07
RE: Wake up light - by admin - 05.04.2017, 07:37
RE: Wake up light - by Mr.D - 05.04.2017, 17:11
RE: Wake up light - by Mr.D - 03.05.2017, 10:39
RE: Wake up light - by Erwin van der Zwart - 03.05.2017, 14:49
RE: Wake up light - by admin - 03.05.2017, 11:21
RE: Wake up light - by Mr.D - 03.05.2017, 15:29
RE: Wake up light - by Mr.D - 04.05.2017, 16:15
RE: Wake up light - by Erwin van der Zwart - 04.05.2017, 17:56
RE: Wake up light - by admin - 04.05.2017, 18:00
RE: Wake up light - by Mr.D - 04.05.2017, 18:11
RE: Wake up light - by Erwin van der Zwart - 04.05.2017, 18:52
RE: Wake up light - by Mr.D - 04.05.2017, 19:22
RE: Wake up light - by Erwin van der Zwart - 04.05.2017, 19:44
RE: Wake up light - by Mr.D - 06.05.2017, 11:43
RE: Wake up light - by PassivPluss - 07.05.2017, 15:57
RE: Wake up light - by Mr.D - 07.05.2017, 17:43

Forum Jump: