Last active
November 25, 2018 07:56
-
-
Save cgoldberg/0ff48471c434b67e19a6d597e063a171 to your computer and use it in GitHub Desktop.
got root?
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
# add this to the beginning of a bash script to ensure it can only be run with root access. | |
if [[ $EUID -ne 0 ]]; then | |
echo "permission denied." | |
echo "$(basename $0) must be run as root." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment