Skip to content

Instantly share code, notes, and snippets.

@NanoDano
Created June 3, 2020 20:59
Show Gist options
  • Save NanoDano/bef04deb47ae41361efd5f74e01fe02d to your computer and use it in GitHub Desktop.
Save NanoDano/bef04deb47ae41361efd5f74e01fe02d to your computer and use it in GitHub Desktop.
Bash check if user is root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root. Exiting"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment