Cypher Posted August 2, 2009 Posted August 2, 2009 Is their any computer programs that work's like a dead man's switch ? i mean lets say for example i have remote server in Canada and i am in new york and their is a huge power outage in new york and their is no way for me to get internet. Would their be away for me to have a program that would be on my remote server that would after lets say 2 days of me not connecting to it would send out a email to people i want like friends telling them they can not connect to this server right now because of unknown reasons then shut it self down till i actual go their and turn it back on or do any other things i program it to do ? I just wanna know because i think it would be cool to have that for a server i have in my place. Quote
digip Posted August 2, 2009 Posted August 2, 2009 Is their any computer programs that work's like a dead man's switch ? i mean lets say for example i have remote server in Canada and i am in new york and their is a huge power outage in new york and their is no way for me to get internet. Would their be away for me to have a program that would be on my remote server that would after lets say 2 days of me not connecting to it would send out a email to people i want like friends telling them they can not connect to this server right now because of unknown reasons then shut it self down till i actual go their and turn it back on or do any other things i program it to do ? I just wanna know because i think it would be cool to have that for a server i have in my place. Well depending on the OS, you could create either a cron job or windows task and then have it set to go off every 2 days, then you could just login and reset it each time you login, Have a script that deletes it, then regenerates it at a 2 day interval. Then, when you don't show up, we'll assume your dead and take over your server your server will shut down. You can also add a script to email people like you said. Shouldn't be too hard to do. Quote
Cypher Posted August 3, 2009 Author Posted August 3, 2009 hmmmmm got any ideas how else you would use this program and where i should start i have not programed to many things before lol. Quote
m0u53 Posted August 4, 2009 Posted August 4, 2009 well start with a socket that connects to said computer making this a service or a deamon would probly be best basicly have it constanty check for a connection and when the connection != NULL or INVALID then start a timer when the timer == 24hrs or something WinExec a python script or something similar...the concept is really simple and i dont think ive ever heard of such an idea Good Work Quote
ArkNinja Posted August 4, 2009 Posted August 4, 2009 I would just make a simple program to ping it every 2 days, or any other interval for that matter, then send out the email if the ping is not successful. I would probably do it in Python, but im not sure what the actual code would be, probably would be extremely simple however. Quote
digip Posted August 4, 2009 Posted August 4, 2009 You could even make something in PHP and then have your browser open it as the home page, so every time you go online, it resets the server. -or just for fun if someone can get it working - I think Digininja was working on some code that used twitter as a way to send commands to another machine, so this might be something to look into, If you have a cell phone with internet access, you can set up something to send messages to sites like twitter. Have a special twitter account just so you can sms or post on every day with a word or special phrase. The script on your server checks to see the date and special word in the last post from your twitter account rss feed. If date is current and word == true, reset timer. If date is older than 2 days, countdown to dead man switch. Maybe a bit overkill, but hell, thats part of the fun to get it working. Even have phrases that just says, "shutdown", one for "reboot", oe whatever you want to do. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.