#!/bin/sh
# Based on: http://www.novell.com/coolsolutions/feature/11251.html
# Detects which OS and if it is Linux then it will detect which Linux Distribution.

OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`

GetVersionFromFile()
{
    VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
}

if [ "${OS}" = "Linux" ] ; then
    KERNEL=`uname -r`
    if [ -f /etc/redhat-release ] ; then
        DIST='redhat'
    elif [ -f /etc/SUSE-release ] ; then
        DIST=`suse`
    elif [ -f /etc/mandrake-release ] ; then
        DIST='mandrake'
    elif [ -f /etc/debian_version ] ; then
        DIST='debian'
    fi
fi

echo $DIST
