plex-tools/plex-token.sh
deathbybandaid e20984525c test
2023-03-14 10:36:34 -04:00

21 lines
582 B
Bash

#!/bin/bash
# ChuckPa already wrote a great function for getting host info
source ./HostConfig.sh
echo "Getting Host Information"
HostConfig
PLEX_PREFERENCES_XML="$AppSuppDir/Plex Media Server/Preferences.xml"
if [[ -f "$PLEX_PREFERENCES_XML" ]]; then
echo "Plex Preferences.xml found: $PLEX_PREFERENCES_XML"
# get token
LOCAL_PLEX_TOKEN=`cat "${PLEX_PREFERENCES_XML}" | sed -e 's;^.* PlexOnlineToken=";;' | sed -e 's;".*$;;' | tail -1`
echo "Local Token found in $PLEX_PREFERENCES_XML: $LOCAL_PLEX_TOKEN"
else
echo "Plex Preferences.xml not found"
exit
fi