From 926dd8fc144deaf996bd84b2fe91e02dbea1ffa7 Mon Sep 17 00:00:00 2001 From: Joe Cooper Date: Thu, 24 Aug 2017 17:42:46 -0500 Subject: [PATCH] Probably fix RHEL detection --- slib.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/slib.sh b/slib.sh index eba843a..c2393da 100644 --- a/slib.sh +++ b/slib.sh @@ -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)