diff --git a/plexupdate.sh b/plexupdate.sh index 391f7a7..7cfec22 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -302,6 +302,9 @@ if [ "${KEEP}" != "yes" -o ! -f /tmp/kaka ] && [ "${PUBLIC}" == "no" ]; then cat /tmp/failcause >&2 exit 1 fi + + # If the system got here, it means the login was successfull, so we set the TOKEN variable to the authToken from the response + # I use cut -c 14- to cut off the "authToken":" string from the grepped result, can probably be done in a different way TOKEN=$(/dev/null | grep -ioe '"label"[^}]*' | grep -i "\"distro\":\"${DISTRO}\"" | grep -i "\"build\":\"${BUILD}\"" | grep -m1 -ioe 'https://[^\"]*' ) if [ "${CRON}" = "no" ]; then