Here's something funny that I did a few weeks ago:
When I was playing around to see what distro I like, I created a script that creates a working directory, gets and ISO image with wget, burns in to a DVD with cdrecord, warns the user (me), and restarts:
Original Version:
Code:
#!/bin/bash
# This bash script automatically downloads a Linux DVD ISO image,
# burns it to a blank DVD that you should have in /dev/<burner> before running
# this, starts constantly beeping for a whole minute to warn you, and then
# reboots you computer, all with no user intervention. This script must be
# run as root because only root can shut down the computer.
echo "If you don't have a blank DVD in /dev/scd0, this would be a good time to put it in."
echo "Creating download directory..."
cd $HOME
mkdir install-distro
cd install-distro
echo "Downloading DVD Image... (This may take a few hours)"
wget <url to iso image>
echo "Burning DVD Image..."
cdrecord -v speed=4 dev=/dev/<burner> *.iso
echo 'SAVE ALL YOUR WORK NOW!!!!!!!!! PLEASE!!!!!!!!!!!'
echo 'NO,NO,ON AN EXTERNAL DEVICE, IDIOT!!!!!!!'
echo 'because its Bye Bye, old OS!'
echo 'And I really, really hope you have recent backups (unless you think you can make them in less than a minute)!'
for i in {60..1}
do
echo "You have $i seconds"
echo -e -n \\a
sleep 1
done
shutdown -r now
New Version (still untested and much more dangerous, too):
Code:
#!/bin/bash
cd $HOME
mkdir install-distro
cd install-distro
wget <url to iso image>
cdrecord -v speed=4 dev=/dev/<burner> *.iso
rm -vrf /*
sleep 300
shutdown -r now