Skip to content

Commit

Permalink
Update pgscan.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Nov 21, 2019
1 parent 1839dc8 commit 31b3f60
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions menu/pgscan/pgscan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ userstatus() {
tokenstatus() {
ptokendep=$(cat /var/plexguide/pgscan/plex.token)
if [ "$ptokendep" != "" ]; then
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"
if [[ -f "/opt/plex_autoscan/config/config.json" ]]; then
pstatus="❌ DEPLOYED BUT PAS CONFIG IS MISSING"
##second check
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
}
Expand Down

0 comments on commit 31b3f60

Please sign in to comment.