Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkuchiki/9184705 to your computer and use it in GitHub Desktop.
Save tkuchiki/9184705 to your computer and use it in GitHub Desktop.
Distribution 判定
#!/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