From 6477bf6545886ff658696327715b4dd7cddaa497 Mon Sep 17 00:00:00 2001 From: Mark Glenn Date: Tue, 16 Jun 2015 21:39:03 -0500 Subject: [PATCH] Fix check for installed version with no install When Plex is not currently installed, make sure to check that the installed version is blank before assuming it matches the available version. --- plexupdate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexupdate.sh b/plexupdate.sh index ac9fdf6..f90f11a 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -211,7 +211,7 @@ SKIP_DOWNLOAD="no" # Installed version detection (only supported for deb based systems, feel free to submit rpm equivalent) if [ "${REDHAT}" != "yes" ]; then INSTALLED_VERSION=$(dpkg-query -s plexmediaserver 2>/dev/null | grep -Po 'Version: \K.*') - if [[ $FILENAME == *$INSTALLED_VERSION* ]] && [ "${FORCE}" != "yes" ]; then + if [[ $FILENAME == *$INSTALLED_VERSION* ]] && [ "${FORCE}" != "yes" ] && [ ! -z "${INSTALLED_VERSION}" ]; then echo "Your OS reports the latest version of Plex ($INSTALLED_VERSION) is already installed. Use -f to force download." exit 5 fi