mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-14 18:47:16 -07:00
Now properly detects missing email/pass and adds debug feature
By adding -v to the options, the tool prints out the email and password used to authenticate, just-in-case.
This commit is contained in:
parent
1b98ed62f1
commit
7e11b392f7
1 changed files with 7 additions and 2 deletions
|
@ -150,6 +150,7 @@ IGNOREAUTOUPDATE=no
|
|||
SHOWPROGRESS=no
|
||||
WGETOPTIONS="" # extra options for wget. Used for progress bar.
|
||||
CHECKUPDATE=yes
|
||||
VERBOSE=no
|
||||
|
||||
# Default options for package managers, override if needed
|
||||
REDHAT_INSTALL="yum -y install"
|
||||
|
@ -263,7 +264,7 @@ fi
|
|||
|
||||
# Parse commandline
|
||||
ALLARGS=( "$@" )
|
||||
optstring="acCdfFhlpPqrSsuU -l config:,dldir:,email:,pass:,server:,port:,saveconfig"
|
||||
optstring="acCdfFhlpPqrSsuUv -l config:,dldir:,email:,pass:,server:,port:,saveconfig"
|
||||
getopt -T >/dev/null
|
||||
if [ $? -eq 4 ]; then
|
||||
optstring="-o $optstring"
|
||||
|
@ -293,6 +294,7 @@ do
|
|||
(-S) errorLog "SILENT option has been removed, please use QUIET (-q) instead"; cronexit 255;;
|
||||
(-u) AUTOUPDATE_CL=yes;;
|
||||
(-U) IGNOREAUTOUPDATE=yes;;
|
||||
(-v) VERBOSE=yes;;
|
||||
|
||||
(--config) shift; CONFIGFILE="$1"; CONFIGFILE=$(trimQuotes ${CONFIGFILE});;
|
||||
(--dldir) shift; DOWNLOADDIR_CL="$1"; DOWNLOADDIR_CL=$(trimQuotes ${DOWNLOADDIR_CL});;
|
||||
|
@ -487,7 +489,7 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
|
|||
fi
|
||||
|
||||
# Sanity check
|
||||
if [ -z "${EMAIL}" -o -z "${PASS}" ] && [ "${PUBLIC}" = "no" ] && [ ! -f "${FILE_KAKA}" ]; then
|
||||
if [ -z "${EMAIL}" -o -z "${PASS}" ] && [ "${PUBLIC}" = "no" ]; then
|
||||
errorLog "Need username & password to download PlexPass version. Otherwise run with -p to download public version."
|
||||
cronexit 1
|
||||
fi
|
||||
|
@ -639,6 +641,9 @@ if [ "${PUBLIC}" = "no" ]; then
|
|||
RESULTCODE=$(head -n1 "${FILE_RAW}" | grep -oe '[1-5][0-9][0-9]')
|
||||
if [ $RESULTCODE -eq 401 ]; then
|
||||
errorLog "Username and/or password incorrect"
|
||||
if [ "$VERBOSE" = "yes" ]; then
|
||||
errorLog "Tried using \"${EMAIL}\" and \"${PASS}\" "
|
||||
fi
|
||||
cronexit 1
|
||||
elif [ $RESULTCODE -ne 201 ]; then
|
||||
errorLog "Failed to login, debug information:"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue