Add check for getPlexToken() in plexupdate.sh

This commit is contained in:
n1koo 2017-06-14 12:57:09 +03:00
commit 5695d236e2

View file

@ -335,6 +335,11 @@ if [ "${CHECKUPDATE}" = "yes" -a "${AUTOUPDATE}" = "no" ]; then
fi
if [ "${PUBLIC}" = "no" -a -z "$TOKEN" ]; then
declare -f getPlexToken > /dev/null
if [ $? -ne 0 ]; then
error "getPlexToken() function missing, check that it its sourced correctly"
exit 3
fi
if ! getPlexToken; then
error "Unable to get Plex token, falling back to public release"
PUBLIC="yes"