1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-02 06:13:16 +03:00
Files
mariadb-columnstore-engine/oam/install_scripts/os_check.sh
2016-01-06 14:08:59 -06:00

45 lines
1.2 KiB
Bash

#!/bin/bash
#
# Determine the Linux distribution and version that is being run.
#
# Check for GNU/Linux distributions
if [ -f /etc/SuSE-release ]; then
DISTRIBUTION="suse"
elif [ -f /etc/UnitedLinux-release ]; then
DISTRIBUTION="united"
elif [ -f /etc/debian_version ]; then
DISTRIBUTION="debian"
elif [ -f /etc/lsb_version ]; then
DISTRIBUTION="ubuntu"
elif [ -f /etc/redhat-release ]; then
a=`grep -i 'red.*hat.*enterprise.*linux' /etc/redhat-release`
if test $? = 0; then
DISTRIBUTION=rhel
else
a=`grep -i 'red.*hat.*linux' /etc/redhat-release`
if test $? = 0; then
DISTRIBUTION=rh
else
a=`grep -i 'Fedora' /etc/redhat-release`
if test $? = 0; then
DISTRIBUTION=fedora
else
a=`grep -i 'cern.*e.*linux' /etc/redhat-release`
if test $? = 0; then
DISTRIBUTION=cel
else
a=`grep -i 'scientific linux cern' /etc/redhat-release`
if test $? = 0; then
DISTRIBUTION=slc
else
DISTRIBUTION="unknown"
fi
fi
fi
fi
fi
else
DISTRIBUTION="unknown"
fi
echo ${DISTRIBUTION}