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 | DISTRIBUTION="rh" |
---|
| 14 | else |
---|
| 15 | DISTRIBUTION="unknown" |
---|
| 16 | fi |
---|
| 17 | |
---|
| 18 | ### VERSION=`rpm -q redhat-release | sed -e 's#redhat[-]release[-]##'` |
---|
| 19 | |
---|
| 20 | case ${DISTRIBUTION} in |
---|
| 21 | rh) |
---|
| 22 | VERSION=`cat /etc/redhat-release | sed -e 's#[^0-9]##g' -e 's#7[0-2]#73#'` |
---|
| 23 | ;; |
---|
| 24 | debian) |
---|
| 25 | VERSION=`cat /etc/debian_version` |
---|
| 26 | if [ ${VERSION} = "testing/unstable" ]; then |
---|
| 27 | # The debian testing/unstable version must be translated into |
---|
| 28 | # a numeric version number, but no number makes sense so just |
---|
| 29 | # remove the version all together. |
---|
| 30 | VERSION="" |
---|
| 31 | fi |
---|
| 32 | ;; |
---|
| 33 | suse) |
---|
| 34 | VERSION=`cat /etc/SuSE-release | grep 'VERSION' | sed -e 's#[^0-9]##g'` |
---|
| 35 | ;; |
---|
| 36 | united) |
---|
| 37 | VERSION=`cat /etc/UnitedLinux-release` |
---|
| 38 | ;; |
---|
| 39 | *) |
---|
| 40 | VERSION='00' |
---|
| 41 | ;; |
---|
| 42 | esac; |
---|
| 43 | |
---|
| 44 | echo ${DISTRIBUTION}${VERSION} |
---|
Note: See
TracBrowser
for help on using the repository browser.