Hi,
Create virtual object. Add the script below and run it. Now wait until logs the first time. Then disable the script. It will continue to run in the background even though it should be disabled. I would expect when you hit disabled it should kill off any running threads of the script.
thx
Roger
Create virtual object. Add the script below and run it. Now wait until logs the first time. Then disable the script. It will continue to run in the background even though it should be disabled. I would expect when you hit disabled it should kill off any running threads of the script.
thx
Roger
Code:
mac="c0:48:e6:ee:d1:2f"
function sendWOL()
--call the WOL
local WOL = function(target)
local dest_ip="255.255.255.255"
local port=9
local socket = require("socket")
local udpwol = assert(socket.udp())
udpwol:setoption('broadcast', true)
clean_target = string.gsub(target,":","")
clean_target = string.gsub(clean_target,"-","")
hex_target = lmcore.hextostr(clean_target)
payload = lmcore.hextostr("FFFFFFFFFFFF")
for i=1,16 do
payload = payload .. hex_target
end
assert(udpwol:sendto(payload, dest_ip, port))
end
WOL(mac)
WOL(mac)
WOL(mac)
WOL(mac)
WOL(mac)
WOL(mac)
sleep(1)
WOL(mac)
WOL(mac)
WOL(mac)
WOL(mac)
WOL(mac)
WOL(mac)
end
while true do
log("running")
sleep(150)
sendWOL()
log("sent wol")
end