Originally published on the old depletionmode / 2of1 blog (archived copy).
error() { echo "$*. Exiting" exit } [ "$UID" != "0" ] && error "You must be root to run this script"
error()
{
echo "$*. Exiting"
exit
}
[ "$UID" != "0" ] && error "You must be root to run this script"