04.07.2017, 06:05
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.
Then you can shutdown from LM like this:
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)