Created
July 24, 2012 20:29
-
-
Save ryan-blunden/3172439 to your computer and use it in GitHub Desktop.
Exit script if not run with sudo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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