From 891fe98e5d3f3ad991806d22005d7381030ffa5a Mon Sep 17 00:00:00 2001 From: Stian Buch Larsen Date: Fri, 28 Aug 2015 12:46:13 +0200 Subject: [PATCH] Add a if not uptodate :P --- init/20_update_plex.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/init/20_update_plex.sh b/init/20_update_plex.sh index d1ff2b4..0406272 100644 --- a/init/20_update_plex.sh +++ b/init/20_update_plex.sh @@ -1,7 +1,7 @@ #!/bin/bash export DEBIAN_FRONTEND=noninteractive - + INSTALLED=`dpkg-query -W -f='${Version}' plexmediaserver` if [[ "$PLEXPASS" ]]; then echo "PLEXPASS is depricated, please use VERSION" @@ -18,12 +18,16 @@ else fi last=130 - -while [ last -ne "0"]; do - rm -f /tmp/plexmediaserver_*.deb - wget -P /tmp "http://downloads.plexapp.com/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb" - last=$? -done +if [[ ! "$VERSION" == "$INSTALLED "]]; then + echo "Upgradeing from version: $INSTALLED to version: $VERSION" + while [ last -ne "0"]; do + rm -f /tmp/plexmediaserver_*.deb + wget -P /tmp "http://downloads.plexapp.com/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb" + last=$? + done +else + echo "Allready Uptodate" +fi apt-get remove --purge -y plexmediaserver gdebi -n /tmp/plexmediaserver_${VERSION}_amd64.deb