Skip to content

Instantly share code, notes, and snippets.

@daytonn
Created March 12, 2011 17:28
Show Gist options
  • Save daytonn/867388 to your computer and use it in GitHub Desktop.
Save daytonn/867388 to your computer and use it in GitHub Desktop.
shell script to check for root user
ROOT_UID=0
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment