Compatibility with Synology DSM7

This commit is contained in:
Geoff Appleby 2021-08-06 14:17:09 -07:00
commit 388ff66589
2 changed files with 17 additions and 8 deletions

View file

@ -228,7 +228,7 @@ isNewerVersion() {
parseVersion() { parseVersion() {
if [ "${DISTRO}" = "redhat" ]; then if [ "${DISTRO}" = "redhat" ]; then
cut -f2- -d- <<< "$1" | cut -f1-4 -d. cut -f2- -d- <<< "$1" | cut -f1-4 -d.
elif [ "${DISTRO}" = "synology" ]; then elif [ "${DISTRO}" = "synology" -o "${DISTRO}" = "synology-dsm7" ]; then
cut -f2-3 -d- <<< "$1" cut -f2-3 -d- <<< "$1"
else else
cut -f2 -d_ <<< "$1" cut -f2 -d_ <<< "$1"
@ -240,6 +240,8 @@ getPlexVersion() {
dpkg-query --showformat='${Version}' --show plexmediaserver 2>/dev/null dpkg-query --showformat='${Version}' --show plexmediaserver 2>/dev/null
elif [ "${DISTRO}" = "synology" ]; then elif [ "${DISTRO}" = "synology" ]; then
synopkg version "Plex Media Server" 2>/dev/null synopkg version "Plex Media Server" 2>/dev/null
elif [ "${DISTRO}" = "synology-dsm7" ]; then
synopkg version "PlexMediaServer" 2>/dev/null
elif [ "${DISTRO}" = "redhat" ]; then elif [ "${DISTRO}" = "redhat" ]; then
local rpmtemp local rpmtemp
if rpmtemp=$(rpm -q plexmediaserver); then if rpmtemp=$(rpm -q plexmediaserver); then

View file

@ -308,6 +308,9 @@ if [ -z "${DISTRO_INSTALL}" ]; then
fi fi
elif [ -f /etc/synoinfo.conf ]; then elif [ -f /etc/synoinfo.conf ]; then
DISTRO="synology" DISTRO="synology"
if grep -q "major=\"7\"" /etc/VERSION; then
DISTRO="synology-dsm7"
fi
DISTRO_INSTALL="synopkg install" DISTRO_INSTALL="synopkg install"
else else
DISTRO="debian" DISTRO="debian"
@ -493,8 +496,10 @@ if [ "${AUTOINSTALL}" = "yes" ]; then
if [ ${RET} -ne 0 ]; then if [ ${RET} -ne 0 ]; then
# Clarify why this failed, so user won't be left in the dark # Clarify why this failed, so user won't be left in the dark
error "Failed to install update. Command '${DISTRO_INSTALL} "${DOWNLOADDIR}/${FILENAME}"' returned error code ${RET}" error "Failed to install update. Command '${DISTRO_INSTALL} "${DOWNLOADDIR}/${FILENAME}"' returned error code ${RET}"
if [ "${DISTRO}" = "synology" -a ${RET} -eq 1 ]; then if [ ${RET} -eq 1 ]; then
error "On Synology devices, you need to add Plex's public key to Package Center. If you have not done so, follow the instructions at https://support.plex.tv/articles/205165858-how-to-add-plex-s-package-signing-public-key-to-synology-nas-package-center/" if [ "${DISTRO}" = "synology" || "${DISTRO}" = "synology-dsm7" ]; then
error "On Synology devices, you need to add Plex's public key to Package Center. If you have not done so, follow the instructions at https://support.plex.tv/articles/205165858-how-to-add-plex-s-package-signing-public-key-to-synology-nas-package-center/"
fi
fi fi
exit ${RET} exit ${RET}
fi fi
@ -510,18 +515,20 @@ if [ "${AUTODELETE}" = "yes" ]; then
fi fi
if [ "${AUTOSTART}" = "yes" ]; then if [ "${AUTOSTART}" = "yes" ]; then
if [ "${DISTRO}" != "redhat" -a "${DISTRO}" != "synology" ]; then if [ "${DISTRO}" != "redhat" -a "${DISTRO}" != "synology" -a "${DISTRO}" != "synology-dsm7" ]; then
warn "The AUTOSTART [-s] option may not be needed on your distribution." warn "The AUTOSTART [-s] option may not be needed on your distribution."
fi fi
# Check for systemd
if hash systemctl 2>/dev/null; then if [ "${DISTRO}" = "synology" ]; then
synopkg start "Plex Media Server"
elif [ "${DISTRO}" = "synology-dsm7" ]; then
synopkg start "PlexMediaServer"
elif hash systemctl 2>/dev/null; then
systemctl start "$SYSTEMDUNIT" systemctl start "$SYSTEMDUNIT"
elif hash service 2>/dev/null; then elif hash service 2>/dev/null; then
service plexmediaserver start service plexmediaserver start
elif [ -x /etc/init.d/plexmediaserver ]; then elif [ -x /etc/init.d/plexmediaserver ]; then
/etc/init.d/plexmediaserver start /etc/init.d/plexmediaserver start
elif [ "${DISTRO}" = "synology" ]; then
synopkg start "Plex Media Server"
else else
error "AUTOSTART was specified but no startup scripts were found for 'plexmediaserver'." error "AUTOSTART was specified but no startup scripts were found for 'plexmediaserver'."
exit 1 exit 1