Skip to content

Commit

Permalink
update plex_autoscan
Browse files Browse the repository at this point in the history
read lines edit to first execute  if file exist then read plex_autoscan section
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Nov 25, 2019
1 parent 78c49b4 commit 7bf1ef8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions menu/pgscan/pgscan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 7bf1ef8

Please sign in to comment.