From a239be3164352219be22348c90113ba13ed77ffb Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Wed, 4 Apr 2012 17:39:10 +0000 Subject: [PATCH] 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 --- scripts/distro | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/distro b/scripts/distro index cce3f7c61..e54410c90 100755 --- a/scripts/distro +++ b/scripts/distro @@ -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