You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docker-plex/init/30_update_plex.sh

33 lines
1.2 KiB

#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
#The following error is not a error.
INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
9 years ago
[ "$PLEXPASS" ] && echo "PLEXPASS is deprecated, please use VERSION"
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then
VERSION=$(curl -s https://tools.linuxserver.io/latest-plexpass.json | grep "version" | cut -d '"' -f 4)
echo "Useing version: $VERSION from Plexpass latest"
elif [[ $VERSION = "latest" || -z $VERSION ]]; then
VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4)
echo "Useing version: $VERSION from Public latest"
else
echo "Useing version: $VERSION from Manual"
fi
last=130
if [[ "$VERSION" != "$INSTALLED" ]]; then
9 years ago
echo "Upgradeing from version: $INSTALLED to version: $VERSION"
while [[ $last -ne "0" ]]; do
rm -f /tmp/plexmediaserver_*.deb
wget -P /tmp "https://downloads.plex.tv/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
9 years ago
last=$?
done
9 years ago
apt-get remove --purge -y plexmediaserver
9 years ago
gdebi -n /tmp/plexmediaserver_"${VERSION}"_amd64.deb
else
9 years ago
echo "No need to update!"
fi
cp -v /defaults/plexmediaserver /etc/default/plexmediaserver