Giter Club home page Giter Club logo

synology-update-plex's Introduction

synology-update-plex

Script to Auto Update Plex Media Server on Synology NAS

Latest Release Test Donate

Goals

  • Make the echoed messages super clear
  • Make the version checking logic as smart as possible
  • Ensure the script fails if there are any errors
  • Ensure temp files are cleaned up properly
  • Write bash code as idiomatically as possible
  • Attempt to find the "Plex Media Server" directory that contains Preferences.xml efficiently
  • Attempt to support all Synology NAS architectures

Usage

First, SSH into your NAS, save the latest release update-plex.sh script somewhere and set it as executable:

$ ssh you@IP_OF_YOUR_NAS
you@yournas:~$ wget "https://github.com/cowboy/synology-update-plex/releases/latest/download/update-plex.sh"
you@yournas:~$ chmod a+x update-plex.sh

Then, create a Scheduled Task with a User-defined script in the Synology DSM Control Panel:

  • Ensure the User is root
  • Ensure the Run command is /path/to/update-plex.sh
  • Add the --plex-pass option (eg. /path/to/update-plex.sh --plex-pass) if you have Plex Pass and want to enable early access / beta releases

Caveats

  • Be careful when SSHing into your NAS. I'm not responsible if you break anything!
  • This script may contain bugs. I'm not responsible if it breaks anything!
  • This script has been tested on a Synology DS918+ NAS running DSM 7. It should work with other Synology NAS models.
  • This script assumes Plex was installed manually from https://www.plex.tv/media-server-downloads/.
  • This script sends "Plex Media Server" notifications as "Package Center" because it's simpler than doing it any other way.

Common Issues

  • If the script is trying to download the wrong release file for your NAS, please see the comments at the top of the get_arch test suite.
  • If the script fails with Unable to find "Plex Media Server" directory when --plex-pass is specified, you may need to manually change /volume* in the script to your volume's root path.
  • If the script fails with error = [289] while installing package, add Plex as a trusted publisher for package installations.

If you find a bug or an issue not listed here, please file an issue or create a pull request. Explain the situation and include all script output.

References

Adapted from work first published at:

Including other update scripts such as:

License

CC0

To the extent possible under law, Ben Alman has waived all copyright and related or neighboring rights to this work.

synology-update-plex's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

synology-update-plex's Issues

synoinfo.conf command not found, Done, with errors!

Script output

Checking for a Plex Media Server update...
/etc/synoinfo.conf: line 390: filter_Apache2.2=yes: command not found
/etc/synoinfo.conf: line 395: filter_MailPlus-Server=yes: command not found
/etc/synoinfo.conf: line 396: filter_PHP5.6=yes: command not found
/etc/synoinfo.conf: line 397: filter_PHP7.0=yes: command not found

[ Retrieving version data ]
Available version: 1.24.2.4973-2b1b51db9

Done, with errors!

NAS Model

DS718+

DSM Version

DSM 7.0-41890

Additional context

Apache2.2, PHP5.6, PHP7.0 are installed except MailPlus-Server.

FAIL: Unable to find release for armv7l/armv7hf_neon

Hello,

Thanks again for your work.

Since the latest version (1.23.2.4656-85f0adf5b), the script is unable to find the URL for armv7hf_neon

I use the latest script and the issue occurs on all the armv7hf_neon NAS I'm using

No issue with x86_64 arch though...

Done, with error 288

First I got error 289, which I resolved by installing the Plex certificate in Package Center.
After running it again, it still fails with error 288.
uname -m
x86_64
cat /proc/sys/kernel/syno_hw_version
DS218+

Here's the output:

` Checking for a Plex Media Server update...

[ Retrieving version data ]
Available version: 1.22.2.4282-a97b03fad
Installed version: 1.22.0.4163-d8c4875dd

New version available!

[ Finding release ]
{
"label": "Intel 64-bit (DSM 6.0 and newer)",
"build": "linux-x86_64",
"distro": "synology",
"url": "https://downloads.plex.tv/plex-media-server-new/1.22.2.4282-a97b03fad/synology/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk",
"checksum": "3538303aae00573167770d018b668654406d4233"
}

[ Downloading release package ]
2021-04-18 00:35:47 URL:https://downloads.plex.tv/plex-media-server-new/1.22.2.4282-a97b03fad/synology/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk [117944320/117944320] -> "/tmp/plex.pqmw2n/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk" [1]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
Failed to install package /tmp/plex.pqmw2n/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk, error = [288]

[ Cleaning up ]
Removing /tmp/plex.pqmw2n

[ Debugging info ]
script_args=()
script_version='(in-development)'
available_version=1.22.2.4282-a97b03fad
installed_version=1.22.0.4163-d8c4875dd
tmp_dir=/tmp/plex.pqmw2n
package_file=/tmp/plex.pqmw2n/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk

Done, with errors!
`

DS 218+ error Code 279

Script output

Checking for a Plex Media Server update...

[ Retrieving DSM version ]
Found DSM version 7

[ Retrieving version data ]
Available version: 1.32.6.7557-1cf77d501
Installed version: 1.32.5.7349-7000

New version available!

[ Finding release ]
{
  "label": "Intel/AMD 64-bit",
  "build": "linux-x86_64",
  "distro": "synology-dsm7",
  "url": "https://downloads.plex.tv/plex-media-server-new/1.32.6.7557-1cf77d501/synology-dsm7/PlexMediaServer-1.32.6.7557-1cf77d501-x86_64_DSM7.spk",
  "checksum": "f05f6313c4768feaa4cd899022b743eb3b520c76"
}

[ Downloading release package ]
2023-10-03 00:03:02 URL:https://downloads.plex.tv/plex-media-server-new/1.32.6.7557-1cf77d501/synology-dsm7/PlexMediaServer-1.32.6.7557-1cf77d501-x86_64_DSM7.spk [97423360/97423360] -> "/tmp/plex.5SFRGW/PlexMediaServer-1.32.6.7557-1cf77d501-x86_64_DSM7.spk" [1]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
{"error":{"code":0},"results":[{"action":"install","beta":false,"betaIncoming":false,"error":{"code":279,"description":"root partition does not have enough space","space":"root"},"installReboot":false,"installing":true,"language":"enu","last_stage":"prepare_install","package":"PlexMediaServer","packageName":"Plex Media Server","spk":"/tmp/plex.5SFRGW/PlexMediaServer-1.32.6.7557-1cf77d501-x86_64_DSM7.spk","stage":"install_failed","success":false,"username":"","version":"1.32.6.7557-7000"}],"success":false}

[ Cleaning up ]
Removing /tmp/plex.5SFRGW

[ Debugging info ]
script_args=()
script_version=v1.1.0
dsm_major_version=7
available_version=1.32.6.7557-1cf77d501
installed_version=1.32.5.7349-7000
tmp_dir=/tmp/plex.5SFRGW
package_file=/tmp/plex.5SFRGW/PlexMediaServer-1.32.6.7557-1cf77d501-x86_64_DSM7.spk

Done, with errors!

NAS Model

DS 218+

DSM Version

7

Additional context

Add any other context about the problem here.

Script does not update anymore

Script output

Checking for a Plex Media Server update...

[ Initializing notification system ]
Notifications disabled (file /var/cache/texts/enu/mails not found)

[ Retrieving version data ]
Available version: 1.30.0.6486-629d58034

Done, with errors!

NAS Model

DS918+

DSM Version

DSM 7.1.1-42962 Update 1

Current Plex version

1.29.0.6244

Upgrade failing on DSM 7.0-41890

Script output

Checking for a Plex Media Server update...

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: 1.24.0.4930-ab6e1a058

Done, with errors!

NAS Model

DS1019+

DSM Version

DSM 7.0-41890

Additional context

Updated to the latest version of the script and re-ran a few times before posting the issue. Plex's install/upgrade seemed to go well and it's functioning normally otherwise.

EDIT: I should also add I was using the script successfully on DSM 6 and I am running it as root. Also, thank you for your work on this script, it's saved me a ton of time on tedious upgrades!

Failing to update Plex Media Server

Script output

bash /volume1/Software/Scripts/update-plex.sh --plex-pass

Add update-plex.sh script output here.
Checking for a Plex Media Server update...

[ Initializing notification system ]
Notifications installed

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: 1.19.5.3035-864bbcbb7
Installed version: 1.19.4.2935-79e214ead

New version available!

[ Finding release ]
{
"label": "Intel 64-bit (DSM 6.0 and newer)",
"build": "linux-x86_64",
"distro": "synology",
"url": "https://downloads.plex.tv/plex-media-server-new/1.19.5.3035-864bbcbb7/synology/PlexMediaServer-1.19.5.3035-864bbcbb7-x86_64.spk",
"checksum": "8947a3d4bdd9f68d003860df0e0b197b7c1163a4"
}

[ Downloading release package ]
2020-07-20 08:19:00 URL:https://downloads.plex.tv/plex-media-server-new/1.19.5.3035-864bbcbb7/synology/PlexMediaServer-1.19.5.3035-864bbcbb7-x86_64.spk [109557760/109557760] -> "/tmp/plex.jaN1WN/PlexMediaServer-1.19.5.3035-864bbcbb7-x86_64.spk" [1]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
Failed to install package /tmp/plex.jaN1WN/PlexMediaServer-1.19.5.3035-864bbcbb7-x86_64.spk, error = [289]

[ Cleaning up ]
Removing /tmp/plex.jaN1WN

Done, with errors!

NAS Model

DS916+

DSM Version

DSM 6.2.3-25426

Additional context

The script was working like a champ for over a month, and then stopped working unexpectedly.

Error with auto update

Hi, i just installed your script and thanks for your great job by i have an error with it :

Tâche : Auto Update Plex
Heure de début : Thu, 21 Jan 2021 17:45:52 GMT
Heure d’arrêt : Thu, 21 Jan 2021 17:47:02 GMT
État actuel : 1 (Interrompu)
Sortie standard/erreur :
Checking for a Plex Media Server update...

[ Retrieving version data ]
Available version: 1.21.1.3876-3c3adfcb4
Installed version: 1.18.5.2309-f5213a238

New version available!

[ Finding release ]
{
"label": "Intel 64-bit (DSM 6.0 and newer)",
"build": "linux-x86_64",
"distro": "synology",
"url": "https://downloads.plex.tv/plex-media-server-new/1.21.1.3876-3c3adfcb4/synology/PlexMediaServer-1.21.1.3876-3c3adfcb4-x86_64.spk",
"checksum": "c7d9f94ccc001bb5b4a0c1a47bf829dff52a08aa"
}

[ Downloading release package ]
2021-01-21 17:46:59
URL:https://downloads.plex.tv/plex-media-server-new/1.21.1.3876-3c3adfcb4/synology/PlexMediaServer-1.21.1.3876-3c3adfcb4-x86_64.spk
[111687680/111687680] ->
"/tmp/plex.3rVtU8/PlexMediaServer-1.21.1.3876-3c3adfcb4-x86_64.spk"
[1]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
Failed to install package
/tmp/plex.3rVtU8/PlexMediaServer-1.21.1.3876-3c3adfcb4-x86_64.spk,
error = [288]

[ Cleaning up ]
Removing /tmp/plex.3rVtU8

Done, with errors!

Thanks a lot for your help

Noty

How to use e-mail noty via oven NAS settings/solutions?

function init_notifications() {
local lang="$(source /etc/synoinfo.conf; echo "$maillang")"
local mails_file=/var/cache/texts/$lang/mails
if [[ ! -e "$mails_file" ]]; then
header "Initializing notification system"
echo "Notifications disabled (file $mails_file not found)"
return
fi
if [[ ! "$(grep PlexUpdateInstalled $mails_file || true)" ]]; then
header "Initializing notification system"
cp $mails_file $mails_file.bak
cat << 'EOF' >> $mails_file
[PlexUpdateInstalled]
Subject: Successfully updated Plex to %PLEX_VERSION% on %HOSTNAME%
Dear user,
Successfully updated Plex to %PLEX_VERSION% on %HOSTNAME%

https://github.com/cowboy/synology-update-plex
[PlexUpdateError]
Subject: Unable to update Plex to %PLEX_VERSION% on %HOSTNAME%
Dear user,
Unable to update Plex to %PLEX_VERSION% on %HOSTNAME%.
If this error persists, enable saving output results in Task Scheduler and file an issue at https://github.com/cowboy/synology-update-plex/issues including the script output.

https://github.com/cowboy/synology-update-plex
EOF
echo 'Notifications installed'
fi
}

D415play support

Hi,

The DS415play it's not supported (version x86).

FAIL: Unable to find release for DS415play-j/i686/i686

I test on my NAS this code and it's worked :

function get_arch() {
  local arch machine=$1 hw_version=$2
  if [[ "$machine" =~ armv7 ]]; then
    declare -A model_machine_map
    model_machine_map[DS414j]=armv7hf_neon
    model_machine_map[DS115j]=armv7hf
    model_machine_map[RS815]=armv7hf
    model_machine_map[DS216se]=armv7hf
    model_machine_map[DS215jv10-j]=armv7hf_neon
    if [[ "${model_machine_map[$hw_version]+_}" ]]; then
      arch=${model_machine_map[$hw_version]}
    elif [[ "${hw_version//[^0-9]/}" =~ 1[5-8]$ ]]; then
      arch=armv7hf_neon
    else
      arch=armv7hf
    fi
  elif [[ "$hw_version" = 'DS415play-j' ]]; then
      arch=x86
  else
      arch=$machine
  fi
  echo $arch
}

The log :

Installed version: 1.18.5.2309-f5213a238

New version available!

[ Finding release ]
{
  "label": "Intel 32-bit (x10 Series, DS415play, and DS214play)",
  "build": "linux-x86",
  "distro": "synology",
  "url": "https://downloads.plex.tv/plex-media-server-new/1.19.4.2935-79e214ead/synology/PlexMediaServer-1.19.4.2935-79e214ead-x86.spk",
  "checksum": "80b6bdae87587ada31f24eddeb963e7fa6dc23f3"
}

[ Downloading release package ]
2020-06-27 14:14:02 URL:https://downloads.plex.tv/plex-media-server-new/1.19.4.2935-79e214ead/synology/PlexMediaServer-1.19.4.2935-79e214ead-x86.spk [100648960/100648960] -> "/tmp/plex.88gmdE/PlexMediaServer-1.19.4.2935-79e214ead-x86.spk" [1]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
/tmp/plex.88gmdE/PlexMediaServer-1.19.4.2935-79e214ead-x86.spk install successfully

[ Restarting Plex Media Server ]
package Plex Media Server start successfully

[ Cleaning up ]
Removing /tmp/plex.88gmdE

Done!

Find task for Plex token takes a long time to execute

The following step takes a long time to execute

pms_dir="$(find / -type d -name 'Plex Media Server' -execdir test -e "{}/Preferences.xml" \; -print -quit)"

One approach to improve this would be to store the value of pms_dir to a file after the first execution, and check this first before trying the full search.

Happy to implement this if you agree with the approach.

Restart Plex if crash

Hello everyone. Sometimes the Plex application crashes. Outside of the update functions, you need to add a check of the status of the running application, if it fell, then run it.

Done, with error 289

Script output

Aufgabe: Plex Server Update
Startzeit: Thu, 08 Apr 2021 11:52:11 GMT
Stoppzeit: Thu, 08 Apr 2021 11:52:28 GMT
Aktueller Status: 1 (Unterbrochen)
Standardausgabe/Fehler:
Checking for a Plex Media Server update...

[ Retrieving version data ]
Available version: 1.22.2.4282-a97b03fad
Installed version: 1.22.1.4275-6000

New version available!

[ Finding release ]
{
  "label": "Intel 64-bit (DSM 6.0 and newer)",
  "build": "linux-x86_64",
  "distro": "synology",
  "url": "https://downloads.plex.tv/plex-media-server-new/1.22.2.4282-a97b03fad/synology/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk",
  "checksum": "3538303aae00573167770d018b668654406d4233"
}

[ Downloading release package ]
2021-04-08 11:52:22 URL:https://downloads.plex.tv/plex-media-server-new/1.22.2.4282-a97b03fad/synology/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk [117944320/117944320] -> "/tmp/plex.ADWyUo/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk" [1]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
Failed to install package /tmp/plex.ADWyUo/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk, error = [289]

[ Cleaning up ]
Removing /tmp/plex.ADWyUo

Done, with errors!

NAS Model

DS1517+

DSM Version

DSM 6.2.4-25556

Additional context

Manual installation of the same file runs successful.

Current version newer than latest version

Hello,
Firstly thank you for creating this script - cleaner and easier to follow than the post that led me here from plex forum.

Ran your script as is and received:

Checking for a Plex Media Server update...

[ Retrieving version data ]
LATEST VERSION: 1.18.9.2578-513b381af
CURRENT VERSION: 1.19.1.2589-2de7f3266
Plex is up-to-date.

Done!

Then switched to plexpass version (as I'm a subscriber) and got:

Checking for a Plex Media Server update...

[ Using plexpass release channel ]
FAIL: Unable to find Preferences.xml file

Done, with errors!

Please can you let me know where I'm going wrong. I installed the latest 64bit synology package from plex before trying your script.

Thanks!

version check on dsm7

Script output

Checking for a Plex Media Server update...

[ Retrieving DSM version ]
Found DSM version 7

[ Retrieving version data ]
Available version: 1.24.4.5081-e362dc1ee
Installed version: 1.24.4.5081-7000

New version available!

[ Finding release ]
{
  "label": "Intel 64-bit",
  "build": "linux-x86_64",
  "distro": "synology-dsm7",
  "url": "https://downloads.plex.tv/plex-media-server-new/1.24.4.5081-e362dc1ee/synology-dsm7/PlexMediaServer-1.24.4.5081-e362dc1ee-x86_64_DSM7.spk",
  "checksum": "350324c1faf0825a1e9320c8806e33aff693a197"
}

[ Downloading release package ]
2021-10-13 11:55:33 URL:https://downloads.plex.tv/plex-media-server-new/1.24.4.5081-e362dc1ee/synology-dsm7/PlexMediaServer-1.24.4.5081-e362dc1ee-x86_64_DSM7.spk [115599360/115599360] -> "/tmp/plex.78YYcs/PlexMediaServer-1.24.4.5081-e362dc1ee-x86_64_DSM7.spk" [1]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
{"error":{"code":0},"results":[{"action":"upgrade","beta":false,"betaIncoming":false,"error":{"code":0},"finished":true,"installReboot":false,"installing":true,"language":"enu","last_stage":"started","package":"PlexMediaServer","packageName":"Plex Media Server","pid":17367,"scripts":[{"code":0,"message":"","type":"stop"},{"code":0,"message":"","type":"preupgrade"},{"code":0,"message":"","type":"preuninst"},{"code":0,"message":"","type":"postuninst"},{"code":0,"message":"","type":"preinst"},{"code":0,"message":"<br><br><p style='color:blue'>Note: If Plex cannot access your media, verify user <strong>PlexMediaServer</strong> is granted permission in <strong>Control Panel</strong>.</p><br>\nSet access to your media share(s) by performing the following steps:<br><br>\n1. Open <strong>Control Panel</strong> and select <strong>Shared Folder</strong><br>\n2. Select the share which contains your media and click <strong>Edit</strong><br>\n3. Click the <strong>Permissions</strong> tab<br>\n4. Change the dropdown from <strong>Local Users</strong> to <strong>System internal user</strong><br>\n5. Check the <strong>Read/Write</strong> checkbox for the <strong>PlexMediaServer</strong> user<br>\n6. Click <strong>Save</strong> to confirm the new permissions<br>\n7. Repeat steps 2-6 for each share you want Plex Media Server to access<br>\n","type":"postinst"},{"code":0,"message":"","type":"postupgrade"},{"code":0,"message":"","type":"start"}],"spk":"/tmp/plex.78YYcs/PlexMediaServer-1.24.4.5081-e362dc1ee-x86_64_DSM7.spk","stage":"installed_and_started","status":"running","success":true,"username":""}],"success":true}

[ Restarting Plex Media Server ]
{"action":"prepare","error":{"code":0},"stage":"prepare","success":true}

[ Cleaning up ]
Removing /tmp/plex.78YYcs

Done!

NAS Model

DS1515+

DSM Version

7

Additional context

Before update version of PLEX in DSM was 1.24.4.5081-7000
After autoupdate version of PLEX in DSM is 1.24.4.5081-7000

We have cyclic update. Maybe it's not worth to check the version of PLEX after the '-'symbol?

DS215j support

Thanks a lot for your work!

It doesn’t work with DS215j and DS216play, which are armv7hf_neon, because their hardware versions are “DS215jv10-j” and “DS216play-j”.

[edit] With these 2 NAS, it falls into the case “armv7hf” instead of “armv7hf_neon”

Latest update lead to download failure (Unable to find release)

This has been working great for the past week or two I've had it setup, then I noticed there was an update so pulled the new script and tested (no update at the time), seemed to work fine.

Now I have an update available, and it's failing. The browser downloads this file:
https://downloads.plex.tv/plex-media-server-new/1.19.3.2831-181d9145d/synology/PlexMediaServer-1.19.3.2831-181d9145d-x86_64.spk

The logs from update-plex:

Checking for a Plex Media Server update...

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: 1.19.3.2831-181d9145d
Installed version: 1.19.3.2793-36efde971

New version available!

[ Finding release ]
FAIL: Unable to find release for DS415+-j/x86_64/DS415+-j

Done, with errors!

Update while the version is the same

I run the bash to test

`Checking for a Plex Media Server update...

[ Initializing notification system ]
Notifications installed

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: 1.22.2.4282-a97b03fad
Installed version: 1.22.2.4282-6000

New version available!

[ Finding release ]
{
"label": "Intel 64-bit (DSM 6.0 and newer)",
"build": "linux-x86_64",
"distro": "synology",
"url": "https://downloads.plex.tv/plex-media-server-new/1.22.2.4282-a97b03fad/synology/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk",
"checksum": "3538303aae00573167770d018b668654406d4233"
}

[ Downloading release package ]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
/tmp/plex.i9qQb5/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk install successfully

[ Restarting Plex Media Server ]
package Plex Media Server start successfully

[ Cleaning up ]
Removing /tmp/plex.i9qQb5

Done!`

I restart the bash to test, and the update starts again ...

`Checking for a Plex Media Server update...

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: 1.22.2.4282-a97b03fad
Installed version: 1.22.2.4282-6000

New version available!

[ Finding release ]
{
"label": "Intel 64-bit (DSM 6.0 and newer)",
"build": "linux-x86_64",
"distro": "synology",
"url": "https://downloads.plex.tv/plex-media-server-new/1.22.2.4282-a97b03fad/synology/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk",
"checksum": "3538303aae00573167770d018b668654406d4233"
}

[ Downloading release package ]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
/tmp/plex.q6sXaj/PlexMediaServer-1.22.2.4282-a97b03fad-x86_64_DSM6.spk install successfully

[ Restarting Plex Media Server ]
package Plex Media Server start successfully

[ Cleaning up ]
Removing /tmp/plex.q6sXaj

Done!`

The bash does not detect that the version is the same.
DS920+
DSM 6.2.4-25556

Event Notification Template Output

Problem

PR #33 added support for DSM 7. The updates are happening correctly but the event notification template is not rendering correctly. In the notifications area, I see:

{"%COMPANY_NAME%":"Synology DiskStation","%DATE%":"2021-08-18","%DISKSTATION%":"DiskStation","%HOSTNAME%":"[Redacted]","%HOST_SN%":"[Redacted]","%HTTPS_URL%":"[Redacted],[Redacted]","%HTTP_URL%":"[Redacted], [Redacted]","%IP_ADDR%":"[Redacted]","%OSNAME%":"DSM","%PLEX_VERSION%":"1.24.1.4931-1a38e63c6","%TIME%":"04:00"}

NAS Model

DS218+

DSM Version

DSM 7.0-41890

Issue with interuppted update check

I received this in my inbox last night.

Dear user,

Task Scheduler has completed a scheduled task.

Task: Update Plex
Start time: Wed, 17 Jun 2020 23:00:02 GMT
Stop time: Wed, 17 Jun 2020 23:00:12 GMT
Current status: 5 (Interrupted)
Standard output/error:
Checking for a Plex Media Server update...

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: null
Installed version: 1.19.4.2935-79e214ead

New version available!

[ Finding release ]
jq: error (at <stdin>:1): Cannot iterate over null (null)

Done, with errors!


>From DiskStation

I am not sure what the interruption was exactly, but your script did not appear to handle the error as I would expect with a nice output message.

I ran the script manually a short while ago and had no issues, everything worked as expected :)

Just thought you should know.

Task schedule report formatting

Hey,
I get the following message which seems to be not correctly formatted:

Task Scheduler has completed a scheduled task.

Task: synology-update-plex
Start time: Thu, 16 Sep 2021 04:00:01 GMT
Stop time: Thu, 16 Sep 2021 04:06:20 GMT
Current status: 0 (Normal)
Standard output/error:
Checking for a Plex Media Server update...

[ Retrieving DSM version ]
Found DSM version 7

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: 1.24.3.5033-757abe6b4
Installed version: 1.24.2.5000-7000

New version available!

[ Finding release ]
{
"label": "Intel 64-bit",
"build": "linux-x86_64",
"distro": "synology-dsm7",
"url": "https://downloads.plex.tv/plex-media-server-new/1.24.3.5033-757abe6b4/synology-dsm7/PlexMediaServer-1.24.3.5033-757abe6b4-x86_64_DSM7.spk",
"checksum": "b6821b741d71c897aa328d89c6bb1759961ad7d9"
}

[ Downloading release package ]
2021-09-16 04:05:59 URL:https://downloads.plex.tv/plex-media-server-new/1.24.3.5033-757abe6b4/synology-dsm7/PlexMediaServer-1.24.3.5033-757abe6b4-x86_64_DSM7.spk [115445760/115445760] -> "/tmp/plex.iH8cCM/PlexMediaServer-1.24.3.5033-757abe6b4-x86_64_DSM7.spk" [2]

[ Verifying checksum ]
Checksum valid!

[ Installing package ]
{"error":{"code":0},"results":[{"action":"upgrade","beta":false,"betaIncoming":false,"error":{"code":0},"finished":true,"installReboot":false,"installing":true,"language":"enu","last_stage":"started","package":"PlexMediaServer","packageName":"Plex Media Server","pid":18985,"scripts":[{"code":0,"message":"","type":"stop"},{"code":0,"message":"","type":"preupgrade"},{"code":0,"message":"","type":"preuninst"},{"code":0,"message":"","type":"postuninst"},{"code":0,"message":"","type":"preinst"},{"code":0,"message":"

Note: If Plex cannot access your media, verify user PlexMediaServer is granted permission in Control Panel.


\nSet access to your media share(s) by performing the following steps:

\n1. Open Control Panel and select Shared Folder
\n2. Select the share which contains your media and click Edit
\n3. Click the Permissions tab
\n4.
Change the dropdown from Local Users to System internal user
\n5. Check the Read/Write checkbox for the PlexMediaServer user
\n6. Click Save to confirm the new permissions
\n7. Repeat steps 2-6 for each share you want Plex Media Server to access
\n","type":"postinst"},{"code":0,"message":"","type":"postupgrade"},{"code":0,"message":"","type":"start"}],"spk":"/tmp/plex.iH8cCM/PlexMediaServer-1.24.3.5033-757abe6b4-x86_64_DSM7.spk","stage":"installed_and_started","status":"running","success":true,"username":""}],"success":true}

[ Restarting Plex Media Server ]
{"action":"prepare","error":{"code":0},"stage":"prepare","success":true}

[ Cleaning up ]
Removing /tmp/plex.iH8cCM

Done!

Loop update

Hello,
The update is done while the version is already up to date. The problem has just appeared.
Is there an error in the filename on the Plex server side
regards

Done, with errors!

Script output

Task Scheduler has completed a scheduled task.

Task: PlexUpdate
Start time: Thu, 01 Apr 2021 00:00:01 GMT
Stop time: Thu, 01 Apr 2021 00:00:02 GMT
Current status: 1 (Interrupted)
Standard output/error:
Checking for a Plex Media Server update...

[ Retrieving version data ]
Available version: 1.22.1.4228-724c56e62

Done, with errors!


NAS Model

DS218 PLUS

DSM Version

DSM 7.0-41222

Additional context

Checking for a Plex Media Server update...

[ Retrieving version data ]
Available version: 1.22.1.4228-724c56e62

Done, with errors!

Done, with errors!

Script output

Checking for a Plex Media Server update...

[ Enabling Plex Pass releases ]
Found Plex Token

[ Retrieving version data ]
Available version: 1.24.2.4973-2b1b51db9

Done, with errors!

NAS Model

DS1517+

DSM Version

DSM 7.0-41890

Additional context

Auto Update Plex Media Server on Synology NAS Version v1.0.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.