Created
November 1, 2021 05:43
-
-
Save 4piu/ef7a9a170bc4a0127c32bbb2280cdf7e to your computer and use it in GitHub Desktop.
Check root permission in sh
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
#!/usr/bin/env sh | |
if [ "$(id -u)" != "0" ]; then | |
echo "Please run as root" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment