Sunday, December 29, 2013

Shutdown your ubuntu / Debian system with a USB Pendrive

Shutdown your ubuntu / Debian system with a USB Pendrive

It is for fun !!! and a utility!!!

First  find out the vendorId and productId of your USB stick:
$ lsusb
 
my output
Bus 002 Device 002: ID 13fe:3600 Kingston Technology Company Inc.  
 
here
13fe - vendor Id
3600 - Product Id

Now create a file in: /etc/udev/rules.d/
 
I was created file :  100-usb-device-action.rules 
Then add the following line.
ACTION=="add", ATTRS{idVendor}=="13fe", ATTRS{idProduct}=="3600", RUN+="/sbin/shutdown -h now"
 
Substitute your vendorid and ProductID
After saving the file . Just plug your USB Pendrive in any USB Port . Your System will Shutdown!!!!

No comments: