docker-plex-wireguard/init/20_update_plex.sh

58 lines
2 KiB
Bash
Raw Normal View History

2015-05-10 10:50:00 +02:00
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
2015-08-28 12:36:53 +02:00
2015-08-28 12:46:13 +02:00
INSTALLED=`dpkg-query -W -f='${Version}' plexmediaserver`
2015-08-28 12:36:53 +02:00
if [[ "$PLEXPASS" ]]; then
echo "PLEXPASS is depricated, please use VERSION"
fi
if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then
2015-07-19 22:33:48 +02:00
VERSION=$(curl -s https://tools.linuxserver.io/latest-plexpass.json | grep "version" | cut -d '"' -f 4)
echo "Useing version: $VERSION from Plexpass latest"
2015-08-28 12:36:53 +02:00
elif [[ $VERSION = "latest" || -z $VERSION ]]; then
2015-07-19 22:33:48 +02:00
VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4)
echo "Useing version: $VERSION from Public latest"
2015-08-28 12:36:53 +02:00
else
echo "Useing version: $VERSION from Manual"
2015-05-10 10:50:00 +02:00
fi
2015-08-28 12:36:53 +02:00
last=130
2015-08-28 13:59:01 +02:00
if [[ "$VERSION" != "$INSTALLED " ]]; then
2015-08-28 12:46:13 +02:00
echo "Upgradeing from version: $INSTALLED to version: $VERSION"
2015-08-28 13:21:37 +02:00
while [[ $last -ne "0" ]]; do
2015-08-28 12:46:13 +02:00
rm -f /tmp/plexmediaserver_*.deb
wget -P /tmp "http://downloads.plexapp.com/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
last=$?
done
2015-08-28 13:59:01 +02:00
cp -v /defaults/plexmediaserver /etc/default/plexmediaserver
apt-get remove --purge -y plexmediaserver
gdebi -n /tmp/plexmediaserver_${VERSION}_amd64.deb
2015-08-28 12:46:13 +02:00
else
echo "Allready Uptodate"
fi
2015-08-28 12:36:53 +02:00
# INSTALLED=`dpkg-query -W -f='${Version}' plexmediaserver`
# if [ $VERSION ]; then
# echo "Useing version: $VERSION from Manual"
# elif [ "$PLEXPASS" == "1" ]; then
# VERSION=$(curl -s https://tools.linuxserver.io/latest-plexpass.json | grep "version" | cut -d '"' -f 4)
# echo "Useing version: $VERSION from Plexpass latest"
# else
# VERSION=$(curl -s https://tools.linuxserver.io/latest-plex.json| grep "version" | cut -d '"' -f 4)
# echo "Useing version: $VERSION from Public latest"
# fi
# if [ "$VERSION" == "$INSTALLED" ]; then
# exit 0;
# fi
# mv /etc/default/plexmediaserver /tmp/
# apt-get remove --purge -y plexmediaserver
# wget -P /tmp "http://downloads.plexapp.com/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
# gdebi -n /tmp/plexmediaserver_${VERSION}_amd64.deb
# mv /tmp/plexmediaserver /etc/default/