04.05.2017, 18:52
(This post was last modified: 04.05.2017, 19:09 by Erwin van der Zwart.)
Hi,
If you want to avoid a double instance of the script like admin adviced, add this code on top of your script:
and put this at the end of the script:
This code will check if there is already / still a instance running from a previous event and kill it.
BR,
Erwin
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