if grep -qs "PlexOnlineToken" "/config/Library/Application Support/Plex Media Server/Preferences.xml" || [ -z "$PLEX_CLAIM" ]; then
if grep -qs "PlexOnlineToken" "/config/Library/Application Support/Plex Media Server/Preferences.xml"; then
echo "**** Server already claimed ****"
exit 0
elif [ -z "$PLEX_CLAIM" ]; then
echo "**** Server is unclaimed, but no claim token has been set ****"
exit 0
fi
PREFNAME="/config/Library/Application Support/Plex Media Server/Preferences.xml"
@ -76,4 +80,4 @@ if [ -n "$PlexOnlineToken" ]; then
sed -i "s/\/>/ PlexOnlineToken=\"${PlexOnlineToken}\"\/>/g" "${PREFNAME}"
else
echo "Unable to claim Plex server. Either manually claim by connecting to http://serverip:32400/web from the same network subnet, or recreate container with a new claim token."