mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 14:20:18 +00:00
Move release version check inside the else block
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
9028898ba7
commit
c6da627b7d
1 changed files with 4 additions and 4 deletions
|
@ -368,13 +368,13 @@ package_manager_detect() {
|
||||||
|
|
||||||
# If the host OS is centos (or a derivative), epel is required for lighttpd
|
# If the host OS is centos (or a derivative), epel is required for lighttpd
|
||||||
if ! grep -qiE 'fedora|fedberry' /etc/redhat-release; then
|
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
|
if rpm -qa | grep -qi 'epel'; then
|
||||||
printf " %b EPEL repository already installed\\n" "${TICK}"
|
printf " %b EPEL repository already installed\\n" "${TICK}"
|
||||||
else
|
else
|
||||||
# CentOS requires the EPEL repository to gain access to Fedora packages
|
local RH_RELEASE EPEL_PKG
|
||||||
EPEL_PKG="https://dl.fedoraproject.org/pub/epel/epel-release-latest-${CURRENT_CENTOS_VERSION}.noarch.rpm"
|
# 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}"
|
printf " %b Enabling EPEL package repository (https://fedoraproject.org/wiki/EPEL)\\n" "${INFO}"
|
||||||
"${PKG_INSTALL[@]}" "${EPEL_PKG}"
|
"${PKG_INSTALL[@]}" "${EPEL_PKG}"
|
||||||
printf " %b Installed %s\\n" "${TICK}" "${EPEL_PKG}"
|
printf " %b Installed %s\\n" "${TICK}" "${EPEL_PKG}"
|
||||||
|
|
Loading…
Reference in a new issue