Rev | Line | |
---|
[1] | 1 | |
---|
| 2 | # Determine the Linux distribution and version that is being run. |
---|
| 3 | # |
---|
| 4 | |
---|
| 5 | # Check for GNU/Linux distributions |
---|
| 6 | if [ -f /etc/SuSE-release ]; then |
---|
| 7 | DISTRIBUTION="suse" |
---|
| 8 | elif [ -f /etc/UnitedLinux-release ]; then |
---|
| 9 | DISTRIBUTION="united" |
---|
| 10 | elif [ -f /etc/debian_version ]; then |
---|
| 11 | DISTRIBUTION="debian" |
---|
| 12 | elif [ -f /etc/redhat-release ]; then |
---|
| 13 | a=`grep -i 'red.*hat.*enterprise.*linux' /etc/redhat-release` |
---|
| 14 | if test $? = 0; then |
---|
| 15 | DISTRIBUTION=rhel |
---|
| 16 | else |
---|
| 17 | a=`grep -i 'red.*hat.*linux' /etc/redhat-release` |
---|
| 18 | if test $? = 0; then |
---|
| 19 | DISTRIBUTION=rh |
---|
| 20 | else |
---|
| 21 | a=`grep -i 'cern.*e.*linux' /etc/redhat-release` |
---|
| 22 | if test $? = 0; then |
---|
| 23 | DISTRIBUTION=cel |
---|
| 24 | else |
---|
| 25 | a=`grep -i 'scientific.*linux' /etc/redhat-release` |
---|
| 26 | DISTRIBUTION="slc" |
---|
| 27 | fi |
---|
| 28 | fi |
---|
| 29 | fi |
---|
| 30 | else |
---|
| 31 | DISTRIBUTION="unknown" |
---|
| 32 | fi |
---|
| 33 | |
---|
| 34 | ### VERSION=`rpm -q redhat-release | sed -e 's#redhat[-]release[-]##'` |
---|
| 35 | |
---|
| 36 | case ${DISTRIBUTION} in |
---|
| 37 | rh|cel|rhel|slc) |
---|
| 38 | VERSION=`cat /etc/redhat-release | sed -e 's#[^0-9]##g' -e 's#7[0-2]#73#'` |
---|
| 39 | ;; |
---|
| 40 | debian) |
---|
| 41 | VERSION=`cat /etc/debian_version` |
---|
| 42 | if [ ${VERSION} = "testing/unstable" ]; then |
---|
| 43 | # The debian testing/unstable version must be translated into |
---|
| 44 | # a numeric version number, but no number makes sense so just |
---|
| 45 | # remove the version all together. |
---|
| 46 | VERSION="" |
---|
| 47 | fi |
---|
| 48 | ;; |
---|
| 49 | suse) |
---|
| 50 | VERSION=`cat /etc/SuSE-release | grep 'VERSION' | sed -e 's#[^0-9]##g'` |
---|
| 51 | ;; |
---|
| 52 | united) |
---|
| 53 | VERSION=`cat /etc/UnitedLinux-release` |
---|
| 54 | ;; |
---|
| 55 | *) |
---|
| 56 | VERSION='00' |
---|
| 57 | ;; |
---|
| 58 | esac; |
---|
| 59 | |
---|
| 60 | echo ${DISTRIBUTION}${VERSION} |
---|
Note: See
TracBrowser
for help on using the repository browser.