Skip to content

Instantly share code, notes, and snippets.

@cgoldberg
Last active November 25, 2018 07:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cgoldberg/0ff48471c434b67e19a6d597e063a171 to your computer and use it in GitHub Desktop.
Save cgoldberg/0ff48471c434b67e19a6d597e063a171 to your computer and use it in GitHub Desktop.
got root?
# 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