Move release version check inside the else block

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
pull/4828/head
Adam Warner 2 years ago
parent 9028898ba7
commit c6da627b7d
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173

@ -368,13 +368,13 @@ package_manager_detect() {
# If the host OS is centos (or a derivative), epel is required for lighttpd
if ! grep -qiE 'fedora|fedberry' /etc/redhat-release; then
# Check current CentOS major release version
CURRENT_CENTOS_VERSION=$(grep -oP '(?<= )[0-9]+(?=\.?)' /etc/redhat-release)
if rpm -qa | grep -qi 'epel'; then
printf " %b EPEL repository already installed\\n" "${TICK}"
else
# CentOS requires the EPEL repository to gain access to Fedora packages
EPEL_PKG="https://dl.fedoraproject.org/pub/epel/epel-release-latest-${CURRENT_CENTOS_VERSION}.noarch.rpm"
local RH_RELEASE EPEL_PKG
# EPEL not already installed, add it based on the release version
RH_RELEASE=$(grep -oP '(?<= )[0-9]+(?=\.?)' /etc/redhat-release)
EPEL_PKG="https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RH_RELEASE}.noarch.rpm"
printf " %b Enabling EPEL package repository (https://fedoraproject.org/wiki/EPEL)\\n" "${INFO}"
"${PKG_INSTALL[@]}" "${EPEL_PKG}"
printf " %b Installed %s\\n" "${TICK}" "${EPEL_PKG}"

Loading…
Cancel
Save