Skip to content

Commit

Permalink
Update plex script for hotio path
Browse files Browse the repository at this point in the history
  • Loading branch information
GilbN committed Apr 17, 2024
1 parent 1e97720 commit 3503e47
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docker-mods/plex/root/etc/cont-init.d/98-themepark
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ echo -e "Variables set:\\n\
'TP_SCHEME'=${TP_SCHEME}\\n\
'TP_THEME'=${TP_THEME}\\n"

if [[ "${TP_HOTIO}" = true ]]; then
echo 'Changing to Hotio file path!'
APP_FILEPATH='/app/bin'
fi

# Set default
if [[ -z ${TP_DOMAIN} ]]; then
echo 'No domain set, defaulting to theme-park.dev'
Expand Down Expand Up @@ -38,17 +43,17 @@ if [[ -z ${TP_THEME} ]]; then
TP_THEME='organizr'
fi

# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" /usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html; then
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}/css/base" "${APP_FILEPATH}"/usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html; then
echo '---------------------------'
echo '| Adding the stylesheet |'
echo '---------------------------'
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/plex\/plex-base.css'><\/head> /g" /usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/head> /g" /usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/plex\/plex-base.css'><\/head> /g" "${APP_FILEPATH}"/usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/head> /g" "${APP_FILEPATH}"/usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html
printf 'Stylesheet set to %s\n' "${TP_THEME}"
if [[ -n ${TP_ADDON} ]]; then
for addon in $(echo "$TP_ADDON" | tr "|" " "); do
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/plex\/${addon}\/${addon}.css'><\/head> /g" /usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/addons\/plex\/${addon}\/${addon}.css'><\/head> /g" "${APP_FILEPATH}"/usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html
printf 'Added custom addon: %s\n\n' "${addon}"
done
fi
Expand Down

0 comments on commit 3503e47

Please sign in to comment.