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
exit 0
fi
fi
PREFNAME="/config/Library/Application Support/Plex Media Server/Preferences.xml"
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}"
sed -i "s/\/>/ PlexOnlineToken=\"${PlexOnlineToken}\"\/>/g" "${PREFNAME}"
else
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."
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."