cowboy / synology-update-plex

Script to Auto Update Plex Media Server on Synology NAS
113 stars 22 forks source link

version check on dsm7 #42

Closed GorycH79 closed 1 year ago

GorycH79 commented 3 years ago

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?

GorycH79 commented 3 years ago

I suggest changing the functions of getting versions like this:

function set_available_version() { available_version=$(jq -r '.nas["'"$json_dsm_pattern"'"].version' <<< "$downloads_json" | grep -oP '^.+?(?=-)' | cut -d "." -f 1,2,3,4) echo "Available version: $available_version" }

function set_installed_version() { installed_version=$(synopkg version "$pms_package_name" | grep -oP '^.+?(?=-)' | cut -d "." -f 1,2,3,4) echo "Installed version: $installed_version" }

cowboy commented 1 year ago

I believe this is fixed in 436280fa6ff078122f68363294b6be88985541ff. Please let me know if the problem persists!

cowboy commented 1 year ago

This fix has been addressed in the latest release https://github.com/cowboy/synology-update-plex/releases