Additional Synology 72 support

This commit is contained in:
Geoff 2024-11-05 08:57:32 +00:00
commit 42efb941f5
2 changed files with 12 additions and 9 deletions

View file

@ -45,10 +45,13 @@ check_distro() {
DISTRO_INSTALL="apt-get install" DISTRO_INSTALL="apt-get install"
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"
if grep -q "major=\"7\"" /etc/VERSION; then
DISTRO="synology-dsm72"
if grep -q "minor=\"[01]\"" /etc/VERSION; then
DISTRO="synology-dsm7"
fi
fi
else else
DISTRO="unknown" DISTRO="unknown"
fi fi
@ -189,7 +192,7 @@ configure_plexupdate() {
AUTODELETE=yes AUTODELETE=yes
[ -z "$DISTRO" ] && check_distro [ -z "$DISTRO" ] && check_distro
if [ "$DISTRO" == "redhat" -o "$DISTRO" == "synology" -o "$DISTRO" == "synology-dsm7" ]; then if [ "$DISTRO" == "redhat" -o $(echo "${DISTRO}" | cut -c -8) = "synology" ]; then
AUTOSTART=yes AUTOSTART=yes
else else
AUTOSTART= AUTOSTART=

View file

@ -312,13 +312,13 @@ if [ -z "${DISTRO_INSTALL}" ]; then
fi fi
elif [ -f /etc/synoinfo.conf ]; then elif [ -f /etc/synoinfo.conf ]; then
DISTRO="synology" DISTRO="synology"
DISTRO_INSTALL="synopkg install"
if grep -q "major=\"7\"" /etc/VERSION; then if grep -q "major=\"7\"" /etc/VERSION; then
DISTRO="synology-dsm72" DISTRO="synology-dsm72"
if grep -q "minor=\"[01]\"" /etc/VERSION; then if grep -q "minor=\"[01]\"" /etc/VERSION; then
DISTRO="synology-dsm7" DISTRO="synology-dsm7"
fi fi
fi fi
DISTRO_INSTALL="synopkg install"
else else
DISTRO="debian" DISTRO="debian"
DISTRO_INSTALL="${DEBIAN_INSTALL}" DISTRO_INSTALL="${DEBIAN_INSTALL}"
@ -504,8 +504,8 @@ if [ "${AUTOINSTALL}" = "yes" ]; 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 [ ${RET} -eq 1 ]; then if [ ${RET} -eq 1 ]; then
if [ "${DISTRO}" = "synology" || "${DISTRO}" = "synology-dsm7" ]; then if [ "${DISTRO}" = "synology" ]; 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/" error "On Synology DSM6 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 fi
exit ${RET} exit ${RET}
@ -522,13 +522,13 @@ if [ "${AUTODELETE}" = "yes" ]; then
fi fi
if [ "${AUTOSTART}" = "yes" ]; then if [ "${AUTOSTART}" = "yes" ]; then
if [ "${DISTRO}" != "redhat" -a "${DISTRO}" != "synology" -a "${DISTRO}" != "synology-dsm7" ]; then if [ "${DISTRO}" != "redhat" -a $(echo "${DISTRO}" | cut -c -8) != "synology"]; 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
if [ "${DISTRO}" = "synology" ]; then if [ "${DISTRO}" = "synology" ]; then
synopkg start "Plex Media Server" synopkg start "Plex Media Server"
elif [ "${DISTRO}" = "synology-dsm7" ]; then elif [ $(echo "${DISTRO}" | cut -c -13) = "synology-dsm7" ]; then
synopkg start "PlexMediaServer" synopkg start "PlexMediaServer"
elif hash systemctl 2>/dev/null; then elif hash systemctl 2>/dev/null; then
systemctl start "$SYSTEMDUNIT" systemctl start "$SYSTEMDUNIT"