Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function on_msg_receive (msg)
- if started == 0 then
- return
- end
- if msg.out then
- return
- end
- --Damit der "Gelesen Haken" erscheint
- if msg.text then
- mark_read (msg.from.print_name, ok_cb, false)
- end
- if msg.from.print_name ~= 'Vorname Nachname' then
- return
- end
- if (string.lower(msg.text) == 'uptime') then
- local handle = io.popen("sudo python /home/pi/tg/tg_actions.py uptime")
- local res = handle:read("*a")
- handle:close()
- return
- elseif (string.lower(msg.text) == 'shutdown') then
- local handle = io.popen("sudo python /home/pi/tg/tg_actions.py shutdown")
- local res = handle:read("*a")
- handle:close()
- return
- elseif (string.lower(msg.text) == 'reboot') then
- local handle = io.popen("sudo python /home/pi/tg/tg_actions.py reboot")
- local res = handle:read("*a")
- handle:close()
- return
- else
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement