Last active
August 29, 2015 13:57
-
-
Save viniciusban/9814141 to your computer and use it in GitHub Desktop.
Do I have root privileges? Am I inside the Vagrant VM?
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
# Do I have root privileges? | |
# Also known as: Am I running with sudo? | |
if [ $EUID -ne 0 ]; then | |
echo "You must run the script as root or using sudo" | |
exit 1 | |
fi | |
# Am I inside the Vagrant VM? | |
if [ "$SUDO_USER" != "vagrant" ]; then | |
echo "You must be in a VM to run me" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment