From 09970a86ad42fe7be3dca15902d63d123588127f Mon Sep 17 00:00:00 2001 From: Alex Malinovich Date: Thu, 19 Apr 2018 22:15:53 -0700 Subject: [PATCH] Provide alternate reinstall command for FORCE --- plexupdate-core | 15 ++++++++++----- plexupdate.sh | 4 +--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/plexupdate-core b/plexupdate-core index aea1ff5..3d28900 100755 --- a/plexupdate-core +++ b/plexupdate-core @@ -175,19 +175,24 @@ getLocalSHA() { check_distro() { if hash dnf 2>/dev/null; then DISTRO=redhat - DISTRO_INSTALL="dnf -y" + DISTRO_INSTALL="dnf -y install" + DISTRO_REINSTALL="dnf -y reinstall" elif hash yum 2>/dev/null; then DISTRO=redhat - DISTRO_INSTALL="yum -y" + DISTRO_INSTALL="yum -y install" + DISTRO_REINSTALL="yum -y reinstall" elif hash zypper 2>/dev/null; then DISTRO=redhat - DISTRO_INSTALL="zypper -y" + DISTRO_INSTALL="zypper install" + DISTRO_REINSTALL="zypper install --force" elif hash apt 2>/dev/null; then DISTRO=ubuntu - DISTRO_INSTALL="apt" + DISTRO_INSTALL="apt install" + DISTRO_REINSTALL="dpkg -i" elif hash apt-get 2>/dev/null; then DISTRO=ubuntu - DISTRO_INSTALL="apt-get -y" + DISTRO_INSTALL="apt-get -y install" + DISTRO_REINSTALL="apt-get -y install --reinstall" else error "Unable to determine distribution, aborting." exit 1 diff --git a/plexupdate.sh b/plexupdate.sh index 7eff8ea..105f915 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -300,9 +300,7 @@ if [ -z "${DISTRO_INSTALL}" ]; then check_distro BUILD="linux-ubuntu-${ARCH}" if [ "${FORCE}" = "yes" ]; then - DISTRO_INSTALL="${DISTRO INSTALL} reinstall" - else - DISTRO_INSTALL="${DISTRO_INSTALL} install" + DISTRO_INSTALL="${DISTRO REINSTALL}" fi elif [ -z "${DISTRO}" -o -z "${BUILD}" ]; then error "You must define both DISTRO and BUILD"