From 46257ac7536bb1de8904f651c9561f2c57708c60 Mon Sep 17 00:00:00 2001 From: gilbN Date: Thu, 27 May 2021 19:14:13 +0200 Subject: [PATCH] prowlarr mod --- prowlarr/Dockerfile | 7 ++++ prowlarr/root/etc/cont-init.d/98-themepark | 48 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 prowlarr/Dockerfile create mode 100644 prowlarr/root/etc/cont-init.d/98-themepark diff --git a/prowlarr/Dockerfile b/prowlarr/Dockerfile new file mode 100644 index 00000000..a66c908c --- /dev/null +++ b/prowlarr/Dockerfile @@ -0,0 +1,7 @@ +FROM scratch + + LABEL maintainer="GilbN" + LABEL app="Prowlarr" + +#copy local files. +COPY root/ / \ No newline at end of file diff --git a/prowlarr/root/etc/cont-init.d/98-themepark b/prowlarr/root/etc/cont-init.d/98-themepark new file mode 100644 index 00000000..fd88d9ed --- /dev/null +++ b/prowlarr/root/etc/cont-init.d/98-themepark @@ -0,0 +1,48 @@ +#!/usr/bin/with-contenv bash + +echo '---------------------------' +echo '| Prowlarr theme.park Mod |' +echo '---------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_ADDON'=${TP_ADDON}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +APP_FILEPATH='/app/prowlarr/bin/UI/index.html' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/app/bin/UI/index.html' +fi + +# Set default +if [[ -z ${TP_DOMAIN} ]]; then + echo 'No domain set, defaulting to theme-park.dev' + TP_DOMAIN='theme-park.dev' +fi + +case ${TP_DOMAIN} in + *"github.io"*) + echo "Switching to github.io URL style" + TP_DOMAIN="${TP_DOMAIN}\/theme.park" + ;; +esac + +if [[ -z ${TP_THEME} ]]; then + echo 'No theme set, defaulting to organizr-dark' + TP_THEME='organizr-dark' +fi + +# Adding stylesheets +if ! grep -q "${TP_DOMAIN}" "${APP_FILEPATH}"; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + printf 'Added custom addon: %s\n\n' "${TP_ADDON}" + fi +fi \ No newline at end of file