Skip to content

Instantly share code, notes, and snippets.

@ryan-blunden
Created July 24, 2012 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryan-blunden/3172439 to your computer and use it in GitHub Desktop.
Save ryan-blunden/3172439 to your computer and use it in GitHub Desktop.
Exit script if not run with sudo
#Exit if not run with sudo
if [[ $UID != 0 ]]
then
echo "This command requires sudo"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment