mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-14 02:26:56 -07:00
Fix RPM version parsing
This commit is contained in:
parent
5067fc91dc
commit
ebd6a5876b
2 changed files with 10 additions and 2 deletions
|
@ -224,13 +224,21 @@ isNewerVersion() {
|
|||
fi
|
||||
}
|
||||
|
||||
parseVersion() {
|
||||
if [ "${REDHAT}" = "yes" ]; then
|
||||
cut -f2- -d- <<< "$1" | cut -f1-4 -d.
|
||||
else
|
||||
cut -f2 -d_ <<< "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
getPlexVersion() {
|
||||
if [ "${REDHAT}" != "yes" ]; then
|
||||
dpkg-query --showformat='${Version}' --show plexmediaserver 2>/dev/null
|
||||
elif hash rpm 2>/dev/null; then
|
||||
local rpmtemp
|
||||
if rpmtemp=$(rpm -q plexmediaserver); then
|
||||
cut -f2 -d_ <<< "$rpmtemp"
|
||||
parseVersion "$rpmtemp"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
|
|
@ -420,7 +420,7 @@ fi
|
|||
SKIP_DOWNLOAD="no"
|
||||
|
||||
INSTALLED_VERSION="$(getPlexVersion)" || warn "Unable to detect installed version, first time?"
|
||||
FILE_VERSION="$(cut -f2 -d_ <<< "${FILENAME}")"
|
||||
FILE_VERSION="$(parseVersion "${FILENAME}")"
|
||||
verboseOutput INSTALLED_VERSION FILE_VERSION
|
||||
|
||||
if [ "${REDHAT}" = "yes" -a "${AUTOINSTALL}" = "yes" -a "${AUTOSTART}" = "no" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue