Created
June 3, 2020 20:59
-
-
Save NanoDano/bef04deb47ae41361efd5f74e01fe02d to your computer and use it in GitHub Desktop.
Bash check if user is root
This file contains hidden or 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
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