mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 00:11:49 +02:00
add Mandriva detection to distro script, fixes FS#179, patch/report by Gabor Garami
git-svn-id: http://www.observium.org/svn/observer/trunk@2953 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+7
-8
@@ -5,11 +5,6 @@ OS=`uname -s`
|
|||||||
REV=`uname -r`
|
REV=`uname -r`
|
||||||
MACH=`uname -m`
|
MACH=`uname -m`
|
||||||
|
|
||||||
GetVersionFromFile()
|
|
||||||
{
|
|
||||||
VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "${OS}" = "SunOS" ] ; then
|
if [ "${OS}" = "SunOS" ] ; then
|
||||||
OS=Solaris
|
OS=Solaris
|
||||||
ARCH=`uname -p`
|
ARCH=`uname -p`
|
||||||
@@ -22,18 +17,22 @@ elif [ "${OS}" = "Linux" ] ; then
|
|||||||
DIST=$(cat /etc/redhat-release | awk '{print $1}')
|
DIST=$(cat /etc/redhat-release | awk '{print $1}')
|
||||||
if [ "${DIST}" = "CentOS" ]; then
|
if [ "${DIST}" = "CentOS" ]; then
|
||||||
DIST="CentOS"
|
DIST="CentOS"
|
||||||
|
elif [ "${DIST}" = "Mandriva" ]; then
|
||||||
|
DIST="Mandriva"
|
||||||
|
PSEUDONAME=`cat /etc/mandriva-release | sed s/.*\(// | sed s/\)//`
|
||||||
|
REV=`cat /etc/mandriva-release | sed s/.*release\ // | sed s/\ .*//`
|
||||||
else
|
else
|
||||||
DIST="RedHat"
|
DIST="RedHat"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PSUEDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
|
PSEUDONAME=`cat /etc/redhat-release | sed s/.*\(// | sed s/\)//`
|
||||||
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
|
REV=`cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//`
|
||||||
elif [ -f /etc/SuSE-release ] ; then
|
elif [ -f /etc/SuSE-release ] ; then
|
||||||
DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
|
DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
|
||||||
REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
|
REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
|
||||||
elif [ -f /etc/mandrake-release ] ; then
|
elif [ -f /etc/mandrake-release ] ; then
|
||||||
DIST='Mandrake'
|
DIST='Mandrake'
|
||||||
PSUEDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
|
PSEUDONAME=`cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//`
|
||||||
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
|
REV=`cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//`
|
||||||
elif [ -f /etc/debian_version ] ; then
|
elif [ -f /etc/debian_version ] ; then
|
||||||
DIST="Debian `cat /etc/debian_version`"
|
DIST="Debian `cat /etc/debian_version`"
|
||||||
@@ -53,7 +52,7 @@ elif [ "${OS}" = "Linux" ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"
|
# OSSTR="${OS} ${DIST} ${REV}(${PSEUDONAME} ${KERNEL} ${MACH})"
|
||||||
OSSTR="${DIST} ${REV}"
|
OSSTR="${DIST} ${REV}"
|
||||||
elif [ "${OS}" = "Darwin" ] ; then
|
elif [ "${OS}" = "Darwin" ] ; then
|
||||||
if [ -f /usr/bin/sw_vers ] ; then
|
if [ -f /usr/bin/sw_vers ] ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user