04.07.2017, 14:22
(04.07.2017, 06:05)admin Wrote: You can install Lua + Luasocket on Linux and create a simple script which receives UDP messages on a certain port. Then just do os.execute('poweroff') (or 'sudo poweroff' if not running a root) when a certain message is received.
Code:sock = require('socket').udp()
sock:setsockname('*', 12345)
sock:settimeout(1)
while true do
msg = sock:receive()
if msg and msg == 'shutdown' then
os.execute('poweroff')
end
end
Then you can shutdown from LM like this:
Code:sock = require('socket').udp()
sock:sendto('shutdown', '192.168.1.11', 12345)
Thank you for the reply but I was asking how to poweroff some windows machines from LM which is linux based...