mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-20 21:33:16 -07:00
Only store tokens if PMS token is unavailable
This commit is contained in:
parent
6565c3a875
commit
c0353a2a5d
2 changed files with 14 additions and 6 deletions
|
@ -147,17 +147,21 @@ configure_plexupdate() {
|
||||||
[ -f "$CONFIGFILE" ] && source "$CONFIGFILE"
|
[ -f "$CONFIGFILE" ] && source "$CONFIGFILE"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -n "Do you want to install the latest PlexPass releases? (requires PlexPass username and password) "
|
echo -n "Do you want to install the latest PlexPass releases? (requires PlexPass account) "
|
||||||
# The answer to this question and the value of PUBLIC are basically inverted
|
# The answer to this question and the value of PUBLIC are basically inverted
|
||||||
if [ "$PUBLIC" == "yes" ]; then
|
if [ "$PUBLIC" == "yes" ]; then
|
||||||
default=N
|
default=N
|
||||||
fi
|
fi
|
||||||
if yesno $default; then
|
if yesno $default; then
|
||||||
PUBLIC=no
|
PUBLIC=no
|
||||||
source "${FULL_PATH}/plexupdate-core"
|
# If they already have a VALID token, leave it alone
|
||||||
|
if [ -z "$TOKEN" ] || ! verifyToken;
|
||||||
|
if getPlexServerToken; then
|
||||||
|
# Only store the token if it's not in PMS
|
||||||
|
TOKEN=
|
||||||
|
else
|
||||||
getPlexToken
|
getPlexToken
|
||||||
if [ -z "$TOKEN" ]; then
|
fi
|
||||||
abort "Failed to retrieve Plex token, please try again."
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# don't forget to erase old settings if they changed their answer
|
# don't forget to erase old settings if they changed their answer
|
||||||
|
@ -336,7 +340,7 @@ else
|
||||||
install_plexupdate
|
install_plexupdate
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
source "${FULL_PATH}/plexupdate-core"
|
||||||
|
|
||||||
configure_plexupdate
|
configure_plexupdate
|
||||||
configure_cron
|
configure_cron
|
||||||
|
|
|
@ -200,6 +200,10 @@ running() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verifyToken() {
|
||||||
|
wget -qO /dev/null "https://plex.tv/api/resources?X-Plex-Token=${TOKEN}"
|
||||||
|
}
|
||||||
|
|
||||||
# Shared functions
|
# Shared functions
|
||||||
|
|
||||||
# SHARED
|
# SHARED
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue