mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-19 12:59:40 -07:00
Remove REDHAT variable and use DISTRO instead
This commit is contained in:
parent
1aba28a7f0
commit
3e25035a19
2 changed files with 8 additions and 10 deletions
|
@ -226,7 +226,7 @@ isNewerVersion() {
|
||||||
}
|
}
|
||||||
|
|
||||||
parseVersion() {
|
parseVersion() {
|
||||||
if [ "${REDHAT}" = "yes" ]; 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" ]; then
|
||||||
cut -f2-3 -d- <<< "$1"
|
cut -f2-3 -d- <<< "$1"
|
||||||
|
@ -236,11 +236,11 @@ parseVersion() {
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlexVersion() {
|
getPlexVersion() {
|
||||||
if [ "${DISTRO}" = "synology" ]; then
|
if [ "${DISTRO}" = "debian" ]; then
|
||||||
synopkg version "Plex Media Server" 2>/dev/null
|
|
||||||
elif [ "${REDHAT}" != "yes" ]; then
|
|
||||||
dpkg-query --showformat='${Version}' --show plexmediaserver 2>/dev/null
|
dpkg-query --showformat='${Version}' --show plexmediaserver 2>/dev/null
|
||||||
elif hash rpm 2>/dev/null; then
|
elif [ "${DISTRO}" = "synology" ]; then
|
||||||
|
synopkg version "Plex Media Server" 2>/dev/null
|
||||||
|
elif [ "${DISTRO}" = "redhat" ]; then
|
||||||
local rpmtemp
|
local rpmtemp
|
||||||
if rpmtemp=$(rpm -q plexmediaserver); then
|
if rpmtemp=$(rpm -q plexmediaserver); then
|
||||||
parseVersion "$rpmtemp"
|
parseVersion "$rpmtemp"
|
||||||
|
|
|
@ -300,7 +300,6 @@ if [ -z "${DISTRO_INSTALL}" ]; then
|
||||||
if [ -z "${DISTRO}" ]; then
|
if [ -z "${DISTRO}" ]; then
|
||||||
# Detect if we're running on redhat instead of ubuntu
|
# Detect if we're running on redhat instead of ubuntu
|
||||||
if [ -f /etc/redhat-release ]; then
|
if [ -f /etc/redhat-release ]; then
|
||||||
REDHAT=yes
|
|
||||||
DISTRO="redhat"
|
DISTRO="redhat"
|
||||||
if ! hash dnf 2>/dev/null; then
|
if ! hash dnf 2>/dev/null; then
|
||||||
DISTRO_INSTALL="${REDHAT_INSTALL/dnf/yum}"
|
DISTRO_INSTALL="${REDHAT_INSTALL/dnf/yum}"
|
||||||
|
@ -311,7 +310,6 @@ if [ -z "${DISTRO_INSTALL}" ]; then
|
||||||
DISTRO="synology"
|
DISTRO="synology"
|
||||||
DISTRO_INSTALL="synopkg install"
|
DISTRO_INSTALL="synopkg install"
|
||||||
else
|
else
|
||||||
REDHAT=no
|
|
||||||
DISTRO="debian"
|
DISTRO="debian"
|
||||||
DISTRO_INSTALL="${DEBIAN_INSTALL}"
|
DISTRO_INSTALL="${DEBIAN_INSTALL}"
|
||||||
fi
|
fi
|
||||||
|
@ -427,7 +425,7 @@ INSTALLED_VERSION="$(getPlexVersion)" || warn "Unable to detect installed versio
|
||||||
FILE_VERSION="$(parseVersion "${FILENAME}")"
|
FILE_VERSION="$(parseVersion "${FILENAME}")"
|
||||||
verboseOutput INSTALLED_VERSION FILE_VERSION
|
verboseOutput INSTALLED_VERSION FILE_VERSION
|
||||||
|
|
||||||
if [ "${REDHAT}" = "yes" -a "${AUTOINSTALL}" = "yes" -a "${AUTOSTART}" = "no" ]; then
|
if [ "${DISTRO}" = "redhat" -a "${AUTOINSTALL}" = "yes" -a "${AUTOSTART}" = "no" ]; then
|
||||||
warn "Your distribution may require the use of the AUTOSTART [-s] option for the service to start after the upgrade completes."
|
warn "Your distribution may require the use of the AUTOSTART [-s] option for the service to start after the upgrade completes."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -486,7 +484,7 @@ if [ -n "${PLEXSERVER}" -a "${AUTOINSTALL}" = "yes" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${AUTOINSTALL}" = "yes" ]; then
|
if [ "${AUTOINSTALL}" = "yes" ]; then
|
||||||
if ! hash ldconfig 2>/dev/null && [ "${REDHAT}" = "no" ]; then
|
if ! hash ldconfig 2>/dev/null && [ "${DISTRO}" != "redhat" ]; then
|
||||||
export PATH=$PATH:/sbin
|
export PATH=$PATH:/sbin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -509,7 +507,7 @@ if [ "${AUTODELETE}" = "yes" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${AUTOSTART}" = "yes" ]; then
|
if [ "${AUTOSTART}" = "yes" ]; then
|
||||||
if [ "${REDHAT}" = "no" ]; then
|
if [ "${DISTRO}" != "redhat" ]; 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
|
# Check for systemd
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue