Auto upgrade / deploy plex on debian

For Debian i created an autoinstaller based on if the file exists.
This script wil not check plex actual version but checks the latest file downloaded.
When there is no file or not the latest file then it will download it and deploy plex.

If you want to reinstall plex simple remove plex and remove the install file it will then perform an clean install.

And yes this is quick and dirty but i was done waiting on plex for creating an official way. (Simple check against plex DB and latest file in URL should be more than enough and doable from shell as a cron)

Requirements:

Run: apt-get install wget curl php-cli

Script:
Save the following file as deployplex.php in a directory on the server.

<?php $rootdir=getcwd(); $url=shell_exec('curl -Ls -o /dev/null -w %{url_effective} "https://plex.tv/downloads/latest/5?channel=8&build=linux-x86_64&distro=debian"'); $ToSplit= explode("/", $url); foreach ($ToSplit as $value) { $Installfile= $value; } $filename = $rootdir.'/'.$Installfile; if (file_exists($filename)) { } else { shell_exec('wget '.$url); $ToExec='dpkg -i '.$rootdir.'/'.$Installfile; shell_exec($ToExec); } ?>

Cronjob:

in crontab place the following tekst.

0 */1 * * * php /CHANGEME/deployplex.php

Forgive me,

You do realize that if you enable the repository and automatic system updates, PMS will automatically update every time a new version is pushed to Public?

The repository always is way behind, the webinterface keeps comming with alerts that there is a new version.
This way i know 100% sure that i have the latest version.

Change the selector to Public.
You currently have it set to Beta.

mrworf has had a widely used script that does this. It has been available for years.

nope i have it on public nice try :wink: Not my first rodeo :wink:

interesting, will look into that one :wink: plex should really integrate some form of this.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.