Created
October 21, 2015 09:14
-
-
Save kapb14/50c9c660f88ecac9d18a to your computer and use it in GitHub Desktop.
bash. проверка запуска через sudo
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
if [ "$UID" != "0" ]; then | |
echo "$UID" | |
echo "Please run as root or via sudo" | |
exit | |
else | |
echo "$UID" | |
echo "OK." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment