mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00: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:
@ -5,11 +5,6 @@ OS=`uname -s`
|
||||
REV=`uname -r`
|
||||
MACH=`uname -m`
|
||||
|
||||
GetVersionFromFile()
|
||||
{
|
||||
VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
|
||||
}
|
||||
|
||||
if [ "${OS}" = "SunOS" ] ; then
|
||||
OS=Solaris
|
||||
ARCH=`uname -p`
|
||||
@ -22,18 +17,22 @@ elif [ "${OS}" = "Linux" ] ; then
|
||||
DIST=$(cat /etc/redhat-release | awk '{print $1}')
|
||||
if [ "${DIST}" = "CentOS" ]; then
|
||||
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
|
||||
DIST="RedHat"
|
||||
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/\ .*//`
|
||||
elif [ -f /etc/SuSE-release ] ; then
|
||||
DIST=`cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//`
|
||||
REV=`cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //`
|
||||
elif [ -f /etc/mandrake-release ] ; then
|
||||
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/\ .*//`
|
||||
elif [ -f /etc/debian_version ] ; then
|
||||
DIST="Debian `cat /etc/debian_version`"
|
||||
@ -53,7 +52,7 @@ elif [ "${OS}" = "Linux" ] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# OSSTR="${OS} ${DIST} ${REV}(${PSUEDONAME} ${KERNEL} ${MACH})"
|
||||
# OSSTR="${OS} ${DIST} ${REV}(${PSEUDONAME} ${KERNEL} ${MACH})"
|
||||
OSSTR="${DIST} ${REV}"
|
||||
elif [ "${OS}" = "Darwin" ] ; then
|
||||
if [ -f /usr/bin/sw_vers ] ; then
|
||||
|
Reference in New Issue
Block a user