Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active Aug 29, 2015
Embed
What would you like to do?
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