I am currently running Ubuntu 12.04 LTS (installed using Wubi) on a Dell Dimention 3000 (not a server). I want to install some software that will listen on a certain port, and shut down the system upon either a connection, or a command. I have tried using SSH, but I want something faster. Something similar to Tomcat's shutdown port is what I am looking for. Another option is possibly a tomcat webapp (I run tomcat on that server), that on load will shut down my computer. However, I definitely prefer another software to handle that task. Any help is appreciated.
Thank you very much, vikarjramun
A simple Google search for "perl tcp server example" will show your several (405,000) examples of how to write a simple client (to send a "shutdown" message to port 30102 on the server) and a simple TCP/IP server to listen for the connection on port 30102, do the desired identification/authentication/authorization dance, then (if the server is started as
root
) shutdown the system.Specto
sounds like what you want, install it with:Then launch it with
specto
or search for it in the dash. To set it to listen on a port and then shutdown the machine when there is activity do:Add
button and then goSystem > Port
.Advanced options
tab and set it to runsudo poweroff
when there is activity on that port.specto
to your startup items and run it withsudo
too.