Hi all,

this is my script that runs every night to auto update PMS Plex Pass on my Synology.

maybe someone want it:

EDIT

i have published a GitHub



GitHub martinorob/plexupdate Automatically update Plex Media Server on Synology NAS - martinorob/plexupdate

Thanks to all!

M.

#!/bin/bash mkdir -p /tmp/plex/ > /dev/null 2>&1 token=$(cat /volume1/Plex/Library/Application\ Support/Plex\ Media\ Server/Preferences.xml | grep -oP 'PlexOnlineToken="\K[^"]+') url=$(echo "https://plex.tv/api/downloads/5.json?channel=plexpass&X-Plex-Token=$token") jq=$(curl -s ${url}) newversion=$(echo $jq | jq -r .nas.Synology.version) echo New Ver: $newversion curversion=$(synopkg version "Plex Media Server") echo Cur Ver: $curversion if [ "$newversion" != "$curversion" ] then echo New Vers Available /usr/syno/bin/synonotify PKGHasUpgrade '{"[%HOSTNAME%]": $(hostname), "[%OSNAME%]": "Synology", "[%PKG_HAS_UPDATE%]": "Plex", "[%COMPANY_NAME%]": "Synology"}' CPU=$(uname -m) url=$(echo "${jq}" | jq -r '.nas.Synology.releases[] | select(.build=="linux-'"${CPU}"'") | .url') /bin/wget $url -P /tmp/plex/ /usr/syno/bin/synopkg install /tmp/plex/*.spk sleep 30 /usr/syno/bin/synopkg start "Plex Media Server" rm -rf /tmp/plex/* else echo No New Ver fi exit

crontab:

cat /etc/crontab

0 3 * * * root /volume1/Script/plexupdate.sh 2>&1 &

rev1 fix

rev2 notification

rev3 cpu based url (x86 or x32)

rev4 extract token in better way

rev5 compatible with all CPU

rev6 typo