Merge pull request #5 from mrworf/master

Merging updates
This commit is contained in:
Devin Slick 2016-03-13 09:10:42 -05:00
commit 9a5c177d54

View file

@ -48,7 +48,7 @@ DOWNLOADDIR="."
# Defaults # Defaults
# (aka "Advanced" settings, can be overriden with config file) # (aka "Advanced" settings, can be overriden with config file)
RELEASE="64-bit" RELEASE="64"
KEEP=no KEEP=no
FORCE=no FORCE=no
PUBLIC=no PUBLIC=no
@ -69,6 +69,17 @@ if [ -f ~/.plexupdate ]; then
source ~/.plexupdate source ~/.plexupdate
fi fi
if [ "${RELEASE}" = "64-bit" ]; then
echo "WARNING: RELEASE=64-bit is deprecated, use RELEASE=64 instead"
RELEASE="64"
elif [ "${RELEASE}" = "32-bit" ]; then
echo "WARNING: RELEASE=32-bit is deprecated, use RELEASE=32 instead"
RELEASE="32"
elif [ "${RELEASE}" != "64" -a "${RELEASE}" != "32" ]; then
echo "ERROR: Use of RELEASE=${RELEASE} will no longer work"
exit 255
fi
# Current pages we need - Do not change unless Plex.tv changes again # Current pages we need - Do not change unless Plex.tv changes again
URL_LOGIN=https://plex.tv/users/sign_in URL_LOGIN=https://plex.tv/users/sign_in
URL_DOWNLOAD=https://plex.tv/downloads?channel=plexpass URL_DOWNLOAD=https://plex.tv/downloads?channel=plexpass
@ -85,7 +96,7 @@ do
(-d) AUTODELETE=yes;; (-d) AUTODELETE=yes;;
(-f) FORCE=yes;; (-f) FORCE=yes;;
(-k) KEEP=yes;; (-k) KEEP=yes;;
(-o) RELEASE="32-bit";; (-o) RELEASE="32";;
(-p) PUBLIC=yes;; (-p) PUBLIC=yes;;
(-u) AUTOUPDATE=yes;; (-u) AUTOUPDATE=yes;;
(-U) AUTOUPDATE=no;; (-U) AUTOUPDATE=no;;
@ -121,7 +132,16 @@ if [ "${AUTOUPDATE}" == "yes" ]; then
fi fi
echo "OK" echo "OK"
popd >/dev/null popd >/dev/null
$0 ${ALLARGS} -U if ! type "$0" 2>/dev/null >/dev/null ; then
if [ -f "$0" ]; then
/bin/bash "$0" ${ALLARGS} -U
else
echo "Error: Unable to relaunch, couldn't find $0"
exit 1
fi
else
"$0" ${ALLARGS} -U
fi
exit $? exit $?
fi fi
@ -132,7 +152,7 @@ if [ "${EMAIL}" == "" -o "${PASS}" == "" ] && [ "${PUBLIC}" == "no" ]; then
fi fi
if [ "${AUTOINSTALL}" == "yes" -o "${AUTOSTART}" == "yes" ]; then if [ "${AUTOINSTALL}" == "yes" -o "${AUTOSTART}" == "yes" ]; then
id | grep 'uid=0(' 2>&1 >/dev/null id | grep -i 'uid=0(' 2>&1 >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Error: You need to be root to use autoinstall/autostart option." echo "Error: You need to be root to use autoinstall/autostart option."
exit 1 exit 1
@ -148,12 +168,14 @@ if [ -z "${DOWNLOADDIR}" ]; then
fi fi
# Detect if we're running on redhat instead of ubuntu # Detect if we're running on redhat instead of ubuntu
REDHAT=no;
PKGEXT='.deb'
if [ -f /etc/redhat-release ]; then if [ -f /etc/redhat-release ]; then
REDHAT=yes; REDHAT=yes;
PKGEXT='.rpm' PKGEXT='.rpm'
RELEASE="Fedora${RELEASE}"
else
REDHAT=no;
PKGEXT='.deb'
RELEASE="Ubuntu${RELEASE}"
fi fi
# Useful functions # Useful functions
@ -244,7 +266,7 @@ fi
# Extract the URL for our release # Extract the URL for our release
echo -n "Finding download URL for ${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" echo -e "OK"
if [ "${DOWNLOAD}" == "" ]; then if [ "${DOWNLOAD}" == "" ]; then
@ -323,7 +345,7 @@ if [ "${AUTOSTART}" == "yes" ]; then
if [ -f "/bin/systemctl" ]; then if [ -f "/bin/systemctl" ]; then
systemctl start plexmediaserver.service systemctl start plexmediaserver.service
else else
service plexmediaserver start /sbin/service plexmediaserver start
fi fi
fi fi