@@ -54,10 +54,10 @@ INSTALLED=$(dpkg-query -W -f='${Version}' plexmediaserver)
5454if [[ -z $VERSION && "$PLEXPASS" == "1" || $VERSION = "plexpass" ]]; then echo "VERSION=plexpass is depricated please use version latest"; fi
5555
5656if [[ "$VERSION" = latest || "$VERSION" = plexpass ]]; then
57- VERSION=$(curl -s "https://plex.tv/downloads /latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 )
57+ VERSION=$(curl -s "${PLEX_URL} /latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token=$PLEX_TOKEN"| cut -d "/" -f 5 )
5858 echo "Target version: $VERSION set by: latest\plexpass"
5959elif [[ "$VERSION" = public ]]; then
60- VERSION=$(curl -s "https://plex.tv/downloads /latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token="| cut -d "/" -f 5 )
60+ VERSION=$(curl -s "${PLEX_URL} /latest/1?channel=8&build=linux-ubuntu-x86_64&distro=ubuntu&X-Plex-Token="| cut -d "/" -f 5 )
6161 echo "Target version: $VERSION set by: public"
6262elif [[ -z "$VERSION" ]]; then
6363 echo "Target version: Version not set, Defaulting to supplied version"
@@ -71,8 +71,9 @@ if [[ "$VERSION" == "" ]]; then
7171elif [[ "$VERSION" != "$INSTALLED" ]]; then
7272 echo "Upgrading from version: $INSTALLED to version: $VERSION"
7373 while [[ $last -ne "0" ]]; do
74- rm -f /tmp/plexmediaserver_*.deb
75- wget -P /tmp "https://downloads.plex.tv/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
74+ rm -f /tmp/plexmediaserver_*.deb
75+ curl -o /tmp/plexmediaserver_"${VERSION}"_amd64.deb -L \
76+ "${PLEX_URL}/plex-media-server/$VERSION/plexmediaserver_${VERSION}_amd64.deb"
7677 last=$?
7778 done
7879 [[ ! -e /tmp/plexmediaserver_"${VERSION}"_amd64.deb ]] && exit 0
0 commit comments