There are number of reasons you want to get some shell script execute automatically as soon as you connect your usb drive to your machine, for example you might want to execute some backup program that will copy your data to the memory stick as soon as you connect it or mount the encrypted usb using a key automatically.
//TODO
What I use it for:
As you might have read form my other post, I have a headless Ubuntu Sever [9.04] which does bunch of stuff one of which is controlling my room lights and air condition.
I'll post the details for my set up in another post. But in short what I have is a custom j2ee application running in tomcat server running on my box. It has a servlet that accepts request with URL parameters from inside network without any user authentication and a JSF 2.0 based page that can be accessed from anywhere for which you need authentication. So what I did is on my iPhone add two home screen bookmarks to the servlet with parameter to turn on/off the lights.
The problem is sometimes my wireless router hangs and then I'm unable to turn on the lights until I reboot the router. So sometimes the lights won't turn on and I don't want to walk all the way to the other end of my house just to reboot the router. So I wanted someway to tell my server to execute lights on command. By the forgot to mentioned that my server is in my room connected to internet using wireless connection.
As its a headless server without any keyborad or mouse the only way I can tell it to turn on the light by creating some event and executing some shell script on that event.
So every time I plug in a particular memory stick it will execute the lights on shell script.
Next thing that I want to do is connect my iPhone dock to the server and whenever I place my iPhone on the dock, lights should turn on.
Feel free to suggest any better solution that you can think off.
No comments:
Post a Comment