21.06.2017, 08:40
one more:
Code:
function wol_send(mac_dest)
local mac = ''
for w in string.gmatch(mac_dest, "[0-9A-Za-z][0-9A-Za-z]") do
mac = mac .. string.char(tonumber(w, 16))
end
local udp = require("socket").udp()
udp:settimeout(1)
udp:setoption("broadcast", true)
udp:sendto(string.char(0xff):rep(6) .. mac:rep(16) , '255.255.255.255', 9)
end