diff --git a/root/etc/cont-init.d/50-plex-update b/root/etc/cont-init.d/50-plex-update index e93ad04..219a78f 100644 --- a/root/etc/cont-init.d/50-plex-update +++ b/root/etc/cont-init.d/50-plex-update @@ -4,6 +4,17 @@ [[ ! -e /etc/default/plexmediaserver ]] && \ cp /defaults/plexmediaserver /etc/default/plexmediaserver +# test if plex is installed and try re-pulling latest if not +if dpkg -s plexmediaserver > /dev/null 2>&1 ; then +: +else echo "for some reason plex doesn't appear to be installed, pulling a new copy and exiting out of update script" +curl -o /tmp/plexmediaserver.deb -L \ + "${PLEX_INSTALL}" && \ +dpkg -i --force-confold /tmp/plexmediaserver.deb +rm -f /tmp/plexmediaserver.deb +exit 0 +fi + # set no update message [[ -e /tmp/no-version.nfo ]] && \ rm /tmp/no-version.nfo @@ -102,13 +113,9 @@ printf "\n\n\n%s\n\n\n" "$( /dev/null 2>&1 || \ -(echo "for some reason the update has failed and plex doesn't seem to be installed, retrying a known version" && curl -o /tmp/plexmediaserver.deb -L "${PLEX_INSTALL}" && dpkg -i /tmp/plexmediaserver.deb) - -# recopy config file in case update overwrites our copy +# recopy config file cp /defaults/plexmediaserver /etc/default/plexmediaserver