Discussion
Anyone know how to write a text script Linux file that prints on the screen something like;
Restore image? (y) (n)
If you then press y a program is started that loads a restore image.
If you press n the system reboots after chucking the dvd out.
If you press anything else nothing happens.
Restore image? (y) (n)
If you then press y a program is started that loads a restore image.
If you press n the system reboots after chucking the dvd out.
If you press anything else nothing happens.
#!/bin/bash
echo "Restore image? (y/n)"
read x
if [[ "$x" == [Yy] ]]; then
restoreimage
fi
if [[ "$x" == [Nn] ]]; then
umount /dev/dvd
eject /dev/dvd
shutdown -r 0
fi
1) "restoreimage" is the restore image program
2) assumes that /dev/dvd symlink is set up correctly
3) needs to be run as root for shutdown to work
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


