Must be root

A check to see if the user is root. Useful for scripts that must be run as root.

[code]
# check for root
if [ $(id -u) != "0" ]; then
echo "no"
exit 0
fi

echo "ok…"
# start the script…
[/code]

Leave a Reply

Your email address will not be published. Required fields are marked *