Skip to content

Commit

Permalink
Probably fix RHEL detection
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Aug 24, 2017
1 parent 903e6a6 commit 926dd8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion slib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,12 @@ get_distro () {
if [ -f /etc/redhat-release ]; then # RHEL/CentOS
local os_string
os_string=$(cat /etc/redhat-release)
os_real=$(echo "$os_string" | cut -d' ' -f1) # Doesn't work for Scientific
isrhel=$(echo "$os_string" | grep 'Red Hat')
if [ ! -z "$isrhel" ]; then
os_real='RHEL'
else
os_real=$(echo "$os_string" | cut -d' ' -f1) # Doesn't work for Scientific
fi
os_type=$(echo "$os_real" | tr '[:upper:]' '[:lower:]')
os_version=$(echo "$os_string" | grep -o '[0-9\.]*')
os_major_version=$(echo "$os_version" | cut -d '.' -f1)
Expand Down

0 comments on commit 926dd8f

Please sign in to comment.