From 481143b891bc84dee36fdeafc8f8b98a7d3e59cd Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Fri, 18 Aug 2017 18:12:09 -0400 Subject: [PATCH] Fixes for Red Hat Enterprise Linux 7 and CentOS 6 (#3846) * Changes for Red Hat Enterprise Linux. RHEL uses "rhel" in the ID field in /etc/os-release. We'll leave "redhat" in the script just in case. Also, RHEL uses a two digit version number in the VERSION_ID field. So instead of looking for just "7", look for anything that starts with "7". This should fix RHEL installations as well as not break anything with CentOS. * Fixes issue #3079. "lsb_release -s -r" returns a two digit version number (at least on recent CentOS releases) while the script is looking for a single digit version. We'll change the script so that it only looks for the version starting with 6. This fixes recent releases of CentOS, while also not breaking previous versions that may have used a single digit. --- snipeit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snipeit.sh b/snipeit.sh index 87a3074fe9..662e6bcf5c 100755 --- a/snipeit.sh +++ b/snipeit.sh @@ -151,7 +151,7 @@ case $distro in echo " The installer has detected Debian version $version as the OS." distro=debian ;; - *centos*|*redhat*|*ol*) + *centos*|*redhat*|*ol*|*rhel*) echo " The installer has detected $distro version $version as the OS." distro=centos ;; @@ -292,7 +292,7 @@ case $distro in service apache2 restart ;; centos ) - if [ "$version" == "6" ]; then + if [[ "$version" =~ ^6 ]]; then ##################################### Install for Centos/Redhat 6 ############################################## webdir=/var/www/html @@ -409,7 +409,7 @@ case $distro in service httpd restart - elif [ "$version" == "7" ]; then + elif [[ "$version" =~ ^7 ]]; then ##################################### Install for Centos/Redhat 7 ############################################## webdir=/var/www/html