Last active
August 29, 2015 13:56
-
-
Save tkuchiki/9184705 to your computer and use it in GitHub Desktop.
Distribution 判定
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
#!/bin/sh | |
function check_dist() { | |
if grep -qs -E '(CentOS|Fedora|Oracle|Scientific|Amazon)' /etc/issue; then | |
echo "rhel" | |
return | |
elif grep -qs -E '(Debian|Ubuntu)' /etc/issue; then | |
echo "debian" | |
return | |
else | |
if uname | grep -qs 'Darwin'; then | |
echo "osx" | |
return | |
fi | |
echo "This OS is not supported." | |
exit 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment