mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-14 02:26:56 -07:00
Redid the release detection to be language agnostic
Seems like some versions of wget will happily ask for a localized version of the webpage, causing the processing to fail. Now we look for something which remains static regardless of langauge.
This commit is contained in:
parent
5484b2c368
commit
17851c6507
1 changed files with 8 additions and 6 deletions
|
@ -48,7 +48,7 @@ DOWNLOADDIR="."
|
|||
|
||||
# Defaults
|
||||
# (aka "Advanced" settings, can be overriden with config file)
|
||||
RELEASE="64-bit"
|
||||
RELEASE="64"
|
||||
KEEP=no
|
||||
FORCE=no
|
||||
PUBLIC=no
|
||||
|
@ -85,7 +85,7 @@ do
|
|||
(-d) AUTODELETE=yes;;
|
||||
(-f) FORCE=yes;;
|
||||
(-k) KEEP=yes;;
|
||||
(-o) RELEASE="32-bit";;
|
||||
(-o) RELEASE="32";;
|
||||
(-p) PUBLIC=yes;;
|
||||
(-u) AUTOUPDATE=yes;;
|
||||
(-U) AUTOUPDATE=no;;
|
||||
|
@ -157,12 +157,14 @@ if [ -z "${DOWNLOADDIR}" ]; then
|
|||
fi
|
||||
|
||||
# Detect if we're running on redhat instead of ubuntu
|
||||
REDHAT=no;
|
||||
PKGEXT='.deb'
|
||||
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
REDHAT=yes;
|
||||
PKGEXT='.rpm'
|
||||
RELEASE="Fedora${RELEASE}"
|
||||
else
|
||||
REDHAT=no;
|
||||
PKGEXT='.deb'
|
||||
RELEASE="Ubuntu${RELEASE}"
|
||||
fi
|
||||
|
||||
# Useful functions
|
||||
|
@ -253,7 +255,7 @@ fi
|
|||
# Extract the URL for our release
|
||||
echo -n "Finding download URL for ${RELEASE}..."
|
||||
|
||||
DOWNLOAD=$(wget --load-cookies /tmp/kaka --save-cookies /tmp/kaka --keep-session-cookies "${URL_DOWNLOAD}" -O - 2>/dev/null | grep "${PKGEXT}" | grep -m 1 "${RELEASE}" | sed "s/.*href=\"\([^\"]*\\${PKGEXT}\)\"[^>]*>${RELEASE}.*/\1/" )
|
||||
DOWNLOAD=$(wget --load-cookies /tmp/kaka --save-cookies /tmp/kaka --keep-session-cookies "${URL_DOWNLOAD}" -O - 2>/dev/null | grep "${PKGEXT}" | grep -m 1 "${RELEASE}" | sed "s/.*href=\"\([^\"]*\\${PKGEXT}\)\"[^>]*>.*/\1/" )
|
||||
echo -e "OK"
|
||||
|
||||
if [ "${DOWNLOAD}" == "" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue