/etc/gentoo-release is preferable then /etc/issue

This commit is contained in:
Kolan Sh 2012-05-08 18:07:19 +04:00
parent 852c8ea99d
commit 0824959805
1 changed files with 7 additions and 6 deletions

View File

@ -38,16 +38,17 @@ DISTRIB_ID=
DISTRIB_DESCRIPTION=
DISTRIB_RELEASE=
DISTRIB_CODENAME=
if [ -f /etc/lsb-release ]; then
DISTRIB_ID=`grep ^DISTRIB_ID /etc/lsb-release | cut -d= -f2`
DISTRIB_RELEASE=`grep ^DISTRIB_RELEASE /etc/lsb-release | cut -d= -f2`
DISTRIB_CODENAME=`grep ^DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2`
DISTRIB_DESCRIPTION=`grep ^DISTRIB_DESCRIPTION /etc/lsb-release | cut -d= -f2`
elif [ -f /etc/gentoo-release ]; then
if [ -f /etc/gentoo-release ]; then
DISTRIB_ID=gentoo
DISTRIB_DESCRIPTION=`cat /etc/gentoo-release`
DISTRIB_RELEASE=${DISTRIB_DESCRIPTION##* }
DISTRIB_CODENAME=gentoo
elif [ -f /etc/lsb-release ]; then
DISTRIB_ID=`grep ^DISTRIB_ID /etc/lsb-release | cut -d= -f2`
DISTRIB_RELEASE=`grep ^DISTRIB_RELEASE /etc/lsb-release | cut -d= -f2`
DISTRIB_CODENAME=`grep ^DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2`
DISTRIB_DESCRIPTION=`grep ^DISTRIB_DESCRIPTION /etc/lsb-release | cut -d= -f2`
elif [ -f /etc/debian_version ]; then
DISTRIB_ID=debian
DISTRIB_RELEASE=`cat /etc/debian_version`