From 8134bfdee0200ad49b1a132ec7b258bf978a744b Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Sun, 20 Nov 2016 14:02:42 -0800 Subject: [PATCH] Use dnf on newer redhat systems --- plexupdate.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index 9ab8ca8..80c14ca 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -67,7 +67,7 @@ WGETOPTIONS="" # extra options for wget. Used for progress bar. CHECKUPDATE=yes # Default options for package managers, override if needed -REDHAT_INSTALL="yum -y install" +REDHAT_INSTALL="dnf -y install" DEBIAN_INSTALL="dpkg -i" DISTRO_INSTALL="" @@ -266,7 +266,7 @@ fi # Allow manual control of configfile if [ ! -z "${CONFIGFILE}" ]; then if [ -f "${CONFIGFILE}" ]; then - info "Using configuration: ${CONFIGFILE}" #>/dev/null + info "Using configuration: ${CONFIGFILE}" source "${CONFIGFILE}" else error "Cannot load configuration ${CONFIGFILE}" @@ -471,7 +471,11 @@ if [ -z "${DISTRO_INSTALL}" ]; then REDHAT=yes BUILD="linux-ubuntu-${ARCH}" DISTRO="redhat" - DISTRO_INSTALL="${REDHAT_INSTALL}" + if ! hash dnf 2>/dev/null; then + DISTRO_INSTALL="${REDHAT_INSTALL/dnf/yum}" + else + DISTRO_INSTALL="${REDHAT_INSTALL}" + fi else REDHAT=no BUILD="linux-ubuntu-${ARCH}"