Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plex-core to support synology packages #247

Open
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@myellen
Copy link

commented Nov 28, 2018

Checks DISTRO variable in getPlexVersion and parseVersion to see if script is running on synology.

Fixes #245

myellen added some commits Nov 28, 2018

Update plex-core to support synology packages
checks DISTRO variable in getPlexVersion and parseVersion
include build identifier in FILE_VERSION
change cut to return field 2 and 3 instead of just 2
@demonbane

This comment has been minimized.

Copy link
Collaborator

commented Dec 20, 2018

Is it even possible to install Plex from the command-line on a Synology NAS? I have one that I've got root SSH access on, but I don't know of any way to install the .spk packages from the command-line.

@abl

This comment has been minimized.

Copy link

commented Dec 23, 2018

@demonbane synopkg install <path to .spk file> as root looks like it does the trick.

@demonbane

This comment has been minimized.

Copy link
Collaborator

commented Dec 23, 2018

That's great! Ok, so this can be added because it is an officially supported platform from Plex, but there are a couple of issues that need to be addressed first. In addition to downloading the Synology package, this should also support:

  • Installing the package
  • Starting and stopping the package before/after installation if necessary (I'm not familiar with how synopkg works, so if it already does this automatically then it can be skipped)
  • Verify that the script is running in a bash 4+ environment. DSM was shipping a 3.x bash version until recently, so some users might still have an old version of bash which won't work.
  • Any additional logic specific to how Synology handles packages that I haven't listed here.
@myellen

This comment has been minimized.

Copy link
Author

commented Feb 9, 2019

Do you mean installing the package for the first time? or using your plexupdate installer script? It does handle installing the package using manual setup (but the user does have to follow the instructions on this page first to trust plex packages). I haven't modified installer.sh to detect the synology distro, so installer.sh wont work.

synopkg automatically starts and stops the package for installation.

I don't have an older version of dsm to test with. However, the changes I made don't use any bash functions that weren't already present in the script, so I'd assume it works fine in bash 3.x.

@demonbane

This comment has been minimized.

Copy link
Collaborator

commented Feb 11, 2019

I did a bit of digging and it looks like most (all?) versions of DSM 6 already include bash 4 so I think that should be ok. The existing code is already pretty heavily dependent on bash 4 which is why I mentioned it.

For installation, it would be great if you update installer.sh to support initial setup as well, but the only requirement would be that plexupdate can auto-install the update after downloading it (presumably using the synopkg command provided above).

There should also be some logic added to try to determine if we're running on a synology automatically so that it doesn't have to be specified via an environment variable:

plexupdate/plexupdate.sh

Lines 298 to 315 in 293e6d5

if [ -z "${DISTRO_INSTALL}" ]; then
if [ -z "${DISTRO}" -a -z "${BUILD}" ]; then
# Detect if we're running on redhat instead of ubuntu
if [ -f /etc/redhat-release ]; then
REDHAT=yes
BUILD="linux-ubuntu-${ARCH}"
DISTRO="redhat"
if ! hash dnf 2>/dev/null; then
DISTRO_INSTALL="${REDHAT_INSTALL/dnf/yum}"
else
DISTRO_INSTALL="${REDHAT_INSTALL}"
fi
else
REDHAT=no
BUILD="linux-ubuntu-${ARCH}"
DISTRO="ubuntu"
DISTRO_INSTALL="${DEBIAN_INSTALL}"
fi

I'm excited to see this added, so I'll try to be as responsive as possible to any questions you have so we can get this merged soon. Thanks for working on this!

myellen added some commits Feb 12, 2019

detect synology
update plexupdate.sh to automatically determine if we're running on a synology
update installer.sh
add ability to detect if running on synology in installer.sh
@myellen

This comment has been minimized.

Copy link
Author

commented Feb 12, 2019

I patched plexupdate.sh to detect synology and to work with the new 5.json naming scheme.

I updated installer.sh too. Where does installer.sh set the BUILD variable? or is it not necessary? I define DISTRO and DISTRO_INSTALL inside of check_distro().

@bruvv

This comment has been minimized.

Copy link

commented Apr 16, 2019

any update on this? I am still receiving an issue: #259

@myellen

This comment has been minimized.

Copy link
Author

commented Apr 16, 2019

@d1slact0r no. you can manually download plexupdate-core and plexupdate.sh from my pull request and replace the versions you have on your synology now

Show resolved Hide resolved plexupdate.sh Outdated
add spaces
add spaces before closing brackets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.