[plug] Accidental reboot

Chris Hoy Poy chris at hoypoy.id.au
Tue May 10 16:10:21 WST 2011



This is only going to address the habits of a few people, so fairly useless in a group environment unless you do some RealWork<tm>

[ in /usr/local/reboot or whatever so it sits in your path ]
[ what about "init 6" or "shutdown -h" etc? Theres heaps of ways to reboot systems, so this isn't going to fit all processes ]

Surely just something like :

## #!/bin/bash
## echo -n "You sure you want to do this? > "
## if read -t 3 response; then
##    echo "So be it."
##    /usr/bin/reboot
## else
##   echo "Not rebooting."
## fi

ie a cascading wrapper. 

Haven't tested the above bit, but you get the idea. 

//Chris

----- Original Message -----
From: "Brad Campbell" <brad at fnarfbargle.com>
To: plug at plug.org.au
Sent: Tuesday, 10 May, 2011 3:21:12 PM
Subject: [plug] Accidental reboot

I have a number of machines I routinely use, and a number of virtual
machines inside those. I've lost count of the number of times I've run
"sudo reboot" thinking I was logged into a guest and taken down the host
server.

I've tried all sorts of tricks with /sbin/reboot and /sbin/shutdown to
try and stop me doing dumb things to no avail.. then this afternoon it
hit me.

The system's path is :/bin:/sbin:/..so on

Every user (including root when using an interactive shell) has the path
prepended with /usr/local/bin.

Put together a quick /usr/local/bin/reboot
#!/bin/bash echo Surprise!

Problem solved. Why did it take me so long to think of it?
_______________________________________________ PLUG discussion list:
plug at plug.org.au
http://lists.plug.org.au/mailman/listinfo/plug Committee e-mail:
committee at plug.linux.org.au



More information about the plug mailing list