diff --git a/menu/pgscan/pgscan.sh b/menu/pgscan/pgscan.sh index b794efc9..a93f4b16 100644 --- a/menu/pgscan/pgscan.sh +++ b/menu/pgscan/pgscan.sh @@ -24,18 +24,18 @@ userstatus() { } tokenstatus() { - ptokendep=$(cat /var/plexguide/pgscan/plex.token) - PGSELFTEST=$(curl -LI "http://localhost:32400/system?X-Plex-Token=$(cat /opt/plex_autoscan/config/config.json | jq .PLEX_TOKEN | sed 's/"//g')" -o /dev/null -w '%{http_code}\n' -s) + ptokendep=$(cat /var/plexguide/pgscan/plex.token) if [ "$ptokendep" != "" ]; then - if [ ! -f "/opt/plex_autoscan/config/config.json" ]; then + if [[ ! -f "/opt/plex_autoscan/config/config.json" ]]; then pstatus="❌ DEPLOYED BUT PAS CONFIG MISSING"; - elif [[ $PGSELFTEST -ge 200 && $PGSELFTEST -le 299 ]]; then - pstatus="✅ DEPLOYED" else - pstatus="❌ DEPLOYED BUT PAS TOKEN FAILED" + PGSELFTEST=$(curl -LI "http://localhost:32400/system?X-Plex-Token=$(cat /opt/plex_autoscan/config/config.json | jq .PLEX_TOKEN | sed 's/"//g')" -o /dev/null -w '%{http_code}\n' -s) + if [[ $PGSELFTEST -ge 200 && $PGSELFTEST -le 299 ]]; then pstatus="✅ DEPLOYED" + else pstatus="❌ DEPLOYED BUT PAS TOKEN FAILED"; fi fi else pstatus="⚠️ NOT DEPLOYED"; fi + } plexcheck() {