This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

ssh to shut down a remote pc
#2
Hi,

I'm running some shell commands on a unix box via http. Not the best (and secure) solution, but an option if nobody has a better one. Smile
http://thinkinginsoftware.blogspot.no/20...mands.html

Event script to call command:

require('socket.http')
if (event.getvalue()) then
 url = 'http://x.x.x.x:8088/?cmd=/home/pi/tdtool.py%20--on%XXXXXXXX'
res, err = socket.http.request(url)
else
 url = 'http://x.x.x.x:8088/?cmd=/home/pi/tdtool.py%20--off%XXXXXXXX'
res, err = socket.http.request(url)
end

You could probably shutdown your server with something like:
 url = 'http://x.x.x.x:8088/?cmd=shutdown%20-h%20now'
res, err = socket.http.request(url)

Where x.x.x.x is your HTPC with node installed and the script in the url I posted running.

Jørgen
Reply


Messages In This Thread
RE: ssh to shut down a remote pc - by jorgenbl - 04.01.2016, 20:46
RE: ssh to shut down a remote pc - by admin - 05.01.2016, 07:37
RE: ssh to shut down a remote pc - by admin - 06.01.2016, 07:52
RE: ssh to shut down a remote pc - by baggins - 29.10.2016, 10:40
RE: ssh to shut down a remote pc - by baggins - 30.10.2016, 20:31
RE: ssh to shut down a remote pc - by Igor - 25.06.2020, 09:41
RE: ssh to shut down a remote pc - by admin - 25.06.2020, 11:07

Forum Jump: