mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-20 13:23:21 -07:00
Better checking of where token came from
This commit is contained in:
parent
76f3cac864
commit
53d3086068
2 changed files with 9 additions and 6 deletions
|
@ -3,12 +3,15 @@
|
||||||
URL_LOGIN='https://plex.tv/users/sign_in.json'
|
URL_LOGIN='https://plex.tv/users/sign_in.json'
|
||||||
|
|
||||||
getPlexToken() {
|
getPlexToken() {
|
||||||
[ -z "$TOKEN" ] && getPlexServerToken
|
if [ -n "$TOKEN" ]; then
|
||||||
# Check if we're connected to a terminal
|
echo "Fetching token from config"
|
||||||
if [ -z "$TOKEN" -a -n "$EMAIL" -a -n "$PASS" ]; then
|
elif getPlexServerToken
|
||||||
|
echo "Fetching token from Plex server"
|
||||||
|
elif [ -z "$TOKEN" -a -n "$EMAIL" -a -n "$PASS" ]; then
|
||||||
#TOFIX
|
#TOFIX
|
||||||
echo "WARNING: Storing your email and password has been deprecated. Please re-run extras/installer.sh or see LINK_TO_FAQ."
|
echo "WARNING: Storing your email and password has been deprecated. Please re-run extras/installer.sh or see LINK_TO_FAQ."
|
||||||
getPlexWebToken
|
getPlexWebToken
|
||||||
|
# Check if we're connected to a terminal
|
||||||
elif [ -z "$TOKEN" -a -t 0 ]; then
|
elif [ -z "$TOKEN" -a -t 0 ]; then
|
||||||
echo "To continue, you will need to provide your Plex account credentials."
|
echo "To continue, you will need to provide your Plex account credentials."
|
||||||
echo "Your email and password will only be used to retrieve a 'token' and will not be saved anywhere."
|
echo "Your email and password will only be used to retrieve a 'token' and will not be saved anywhere."
|
||||||
|
@ -30,8 +33,6 @@ getPlexToken() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
getPlexWebToken
|
getPlexWebToken
|
||||||
elif [ -n "$TOKEN" ]; then
|
|
||||||
echo "Fetching token from Plex server"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$TOKEN" ] # simulate exit status
|
[ -n "$TOKEN" ] # simulate exit status
|
||||||
|
@ -80,6 +81,8 @@ getPlexServerToken() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[ -n "$TOKEN" ] # simulate exit status
|
||||||
}
|
}
|
||||||
|
|
||||||
getPlexWebToken() {
|
getPlexWebToken() {
|
||||||
|
|
|
@ -347,7 +347,7 @@ if yesno; then
|
||||||
PROGRESS_OPT="-P"
|
PROGRESS_OPT="-P"
|
||||||
fi
|
fi
|
||||||
if [ "$AUTOINSTALL" == "yes" ]; then
|
if [ "$AUTOINSTALL" == "yes" ]; then
|
||||||
sudo "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
sudo -E "$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
||||||
else
|
else
|
||||||
"$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
"$FULL_PATH/plexupdate.sh" $PROGRESS_OPT --config "$CONFIGFILE"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue