From 38f90c38741c2060d78697fb8e703cf295b48689 Mon Sep 17 00:00:00 2001 From: GilbN Date: Mon, 20 Sep 2021 23:43:51 +0200 Subject: [PATCH] fix for #255 --- .../deluge/root/etc/cont-init.d/98-themepark | 76 ++--- .../emby/root/etc/cont-init.d/98-themepark | 78 +++--- .../jackett/root/etc/cont-init.d/98-themepark | 88 +++--- .../root/etc/cont-init.d/98-themepark | 76 ++--- .../root/etc/cont-init.d/98-themepark | 76 ++--- .../root/etc/cont-init.d/98-themepark | 76 ++--- .../plex/root/etc/cont-init.d/98-themepark | 98 +++---- .../root/etc/cont-init.d/98-themepark | 234 ++++++++-------- .../root/etc/cont-init.d/98-themepark | 76 ++--- .../sabnzbd/root/etc/cont-init.d/98-themepark | 98 +++---- .../root/etc/cont-init.d/98-themepark | 76 ++--- .../root/etc/cont-init.d/98-themepark | 86 +++--- .../root/etc/cont-init.d/98-themepark | 76 ++--- .../root/etc/cont-init.d/98-themepark | 76 ++--- .../root/etc/cont-init.d/98-themepark | 264 +++++++++--------- 15 files changed, 777 insertions(+), 777 deletions(-) diff --git a/docker-mods/deluge/root/etc/cont-init.d/98-themepark b/docker-mods/deluge/root/etc/cont-init.d/98-themepark index 408c8dcb..fdfcd212 100644 --- a/docker-mods/deluge/root/etc/cont-init.d/98-themepark +++ b/docker-mods/deluge/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '---------------------------' -echo '| Deluge theme.park Mod |' -echo '---------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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}" /usr/lib/python3/dist-packages/deluge/ui/web/index.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" /usr/lib/python3/dist-packages/deluge/ui/web/index.html - sed -i "s/<\/head>/<\/head> /g" /usr/lib/python3/dist-packages/deluge/ui/web/index.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '---------------------------' +echo '| Deluge theme.park Mod |' +echo '---------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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}" /usr/lib/python3/dist-packages/deluge/ui/web/index.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" /usr/lib/python3/dist-packages/deluge/ui/web/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/lib/python3/dist-packages/deluge/ui/web/index.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/emby/root/etc/cont-init.d/98-themepark b/docker-mods/emby/root/etc/cont-init.d/98-themepark index 78846bff..5063f222 100644 --- a/docker-mods/emby/root/etc/cont-init.d/98-themepark +++ b/docker-mods/emby/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '-------------------------' -echo '| Emby theme.park Mod |' -echo '-------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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/emby/dashboard-ui/index.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/body>/<\/body> /g" /app/emby/dashboard-ui/index.html - sed -i "s/<\/body>/<\/body> /g" /app/emby/dashboard-ui/index.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " -fi +#!/usr/bin/with-contenv bash + +echo '-------------------------' +echo '| Emby theme.park Mod |' +echo '-------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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/emby/dashboard-ui/index.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/body>/<\/body> /g" /app/emby/dashboard-ui/index.html + sed -i "s/<\/body>/<\/body> /g" /app/emby/dashboard-ui/index.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " +fi diff --git a/docker-mods/jackett/root/etc/cont-init.d/98-themepark b/docker-mods/jackett/root/etc/cont-init.d/98-themepark index aa3fdd2c..707cf4a0 100644 --- a/docker-mods/jackett/root/etc/cont-init.d/98-themepark +++ b/docker-mods/jackett/root/etc/cont-init.d/98-themepark @@ -1,45 +1,45 @@ -#!/usr/bin/with-contenv bash - -echo '---------------------------' -echo '| Jackett theme.park Mod |' -echo '---------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -APP_FILEPATH='/app/Jackett/Content/index.html' -if [ "${TP_HOTIO}" = true ]; then - echo 'Changing to Hotio file path!' - APP_FILEPATH='/app/Content/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}" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '---------------------------' +echo '| Jackett theme.park Mod |' +echo '---------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +APP_FILEPATH='/app/Jackett/Content/index.html' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/app/Content/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}" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/jellyfin/root/etc/cont-init.d/98-themepark b/docker-mods/jellyfin/root/etc/cont-init.d/98-themepark index a68eb848..f8653e22 100644 --- a/docker-mods/jellyfin/root/etc/cont-init.d/98-themepark +++ b/docker-mods/jellyfin/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '-----------------------------' -echo '| Jellyfin theme.park Mod |' -echo '-----------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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}" /usr/share/jellyfin/web/index.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/body>/<\/body> /g" /usr/share/jellyfin/web/index.html - sed -i "s/<\/body>/<\/body> /g" /usr/share/jellyfin/web/index.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '-----------------------------' +echo '| Jellyfin theme.park Mod |' +echo '-----------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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}" /usr/share/jellyfin/web/index.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/body>/<\/body> /g" /usr/share/jellyfin/web/index.html + sed -i "s/<\/body>/<\/body> /g" /usr/share/jellyfin/web/index.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/lazylibrarian/root/etc/cont-init.d/98-themepark b/docker-mods/lazylibrarian/root/etc/cont-init.d/98-themepark index d5a37e4f..5270d780 100644 --- a/docker-mods/lazylibrarian/root/etc/cont-init.d/98-themepark +++ b/docker-mods/lazylibrarian/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '----------------------------------' -echo '| Lazylibrarian theme.park Mod |' -echo '----------------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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/lazylibrarian/data/interfaces/bookstrap/base.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" /app/lazylibrarian/data/interfaces/bookstrap/base.html - sed -i "s/<\/head>/<\/head> /g" /app/lazylibrarian/data/interfaces/bookstrap/base.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '----------------------------------' +echo '| Lazylibrarian theme.park Mod |' +echo '----------------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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/lazylibrarian/data/interfaces/bookstrap/base.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" /app/lazylibrarian/data/interfaces/bookstrap/base.html + sed -i "s/<\/head>/<\/head> /g" /app/lazylibrarian/data/interfaces/bookstrap/base.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/librespeed/root/etc/cont-init.d/98-themepark b/docker-mods/librespeed/root/etc/cont-init.d/98-themepark index 2beac055..d10b338a 100644 --- a/docker-mods/librespeed/root/etc/cont-init.d/98-themepark +++ b/docker-mods/librespeed/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '-------------------------------' -echo '| Librespeed theme.park Mod |' -echo '-------------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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}" /usr/share/webapps/librespeed/index.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" /usr/share/webapps/librespeed/index.html - sed -i "s/<\/head>/<\/head> /g" /usr/share/webapps/librespeed/index.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '-------------------------------' +echo '| Librespeed theme.park Mod |' +echo '-------------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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}" /usr/share/webapps/librespeed/index.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" /usr/share/webapps/librespeed/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/share/webapps/librespeed/index.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/plex/root/etc/cont-init.d/98-themepark b/docker-mods/plex/root/etc/cont-init.d/98-themepark index 3ed7125f..81e36fd8 100644 --- a/docker-mods/plex/root/etc/cont-init.d/98-themepark +++ b/docker-mods/plex/root/etc/cont-init.d/98-themepark @@ -1,50 +1,50 @@ -#!/usr/bin/with-contenv bash - -echo '-------------------------' -echo '| Plex theme.park Mod |' -echo '-------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -APP_FILEPATH='' -if [ "${TP_HOTIO}" = true ]; then - echo 'Changing to Hotio file path!' - APP_FILEPATH='/app' -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}"/usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html - sed -i "s/<\/head>/<\/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>/<\/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 +#!/usr/bin/with-contenv bash + +echo '-------------------------' +echo '| Plex theme.park Mod |' +echo '-------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +APP_FILEPATH='' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/app' +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}"/usr/lib/plexmediaserver/Resources/Plug-ins-*/WebClient.bundle/Contents/Resources/index.html + sed -i "s/<\/head>/<\/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>/<\/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 fi \ No newline at end of file diff --git a/docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark b/docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark index 8c802c93..48c342bd 100644 --- a/docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark +++ b/docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark @@ -1,117 +1,117 @@ -#!/usr/bin/with-contenv bash - -echo '------------------------------' -echo '| qBittorrent theme.park Mod |' -echo '------------------------------' - -APP_FILEPATH='/config/qBittorrent/qBittorrent.conf' -if [ "${TP_HOTIO}" = true ]; then - echo 'Changing to Hotio file path!' - APP_FILEPATH='/config/config/qBittorrent.conf' -fi - -# Backup config -if [[ ! -f "${APP_FILEPATH}.bak" ]]; then - echo "Creating qBittorrent.conf backup in /config." - cp -p ${APP_FILEPATH} "${APP_FILEPATH}.bak" -fi - -# Restore qBittorrent.conf -if [ "${TP_DISABLE_THEME}" = true ]; then - echo "Restoring backup of qBittorrent.conf" - sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=false/g" "${APP_FILEPATH}"; - exit 0 -fi - -if ! [[ -x "$(command -v svn)" ]]; then -echo '--------------------------' -echo '| Installing svn package |' -echo '--------------------------' - apt-get update && \ - apt-get install -y subversion -fi - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'APP_FILEPATH'=${APP_FILEPATH}\\n\ -'TP_DISABLE_THEME'=${TP_DISABLE_THEME}\\n\ -'TP_HOTIO'=${TP_HOTIO}\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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 - -# Downloading fresh webui files from source. -if [[ ! -d /themepark ]]; then - echo '---------------------------------------' - echo '| Downloading WebUI files from github |' - echo '---------------------------------------' - printf '\nDownloading qBittorrent webui to "/themepark"..please wait\n' - svn export --quiet https://github.com/qbittorrent/qBittorrent/trunk/src/webui/www /themepark - printf '\nDownload finished\n\n' - printf '\nDownloading qBittorrent webui icons to "/themepark/xxx"..please wait\n' - svn export --force --quiet https://github.com/qbittorrent/qBittorrent/trunk/src/icons /temp - cp -a /temp/. /themepark/public/icons - cp -a /temp/. /themepark/private/icons - rm -rf /temp - printf '\nDownload finished\n\n' -fi - -sed_file(){ - sed -i "s/<\/head>/<\/head> /g" $1 - sed -i "s/<\/head>/<\/head> /g" $1 - printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1" -} - -# Adding stylesheets -echo '---------------------------------------' -echo '| Adding the stylesheet to html files |' -echo '---------------------------------------' -if ! grep -q "${TP_DOMAIN}" /themepark/public/index.html; then - sed_file /themepark/public/index.html -fi - -if ! grep -q "${TP_DOMAIN}" /themepark/private/index.html; then - find ./themepark/private -type f -iname *.html | while read fname - do - sed_file $fname - done -fi - -if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then - echo '--------------------------------------' - echo '| Adding WebUI\RootFolder=/themepark |' - echo '--------------------------------------' - sed -i -e '$aWebUI\\RootFolder=/themepark' "${APP_FILEPATH}"; -fi - -if ! grep -q "WebUI\\\AlternativeUIEnabled" "${APP_FILEPATH}"; then - echo '------------------------------------------' - echo '| Adding WebUI\AlternativeUIEnabled=true |' - echo '------------------------------------------' - sed -i -e '$aWebUI\\AlternativeUIEnabled=true' "${APP_FILEPATH}"; -fi - -if ! grep -q "WebUI\\\RootFolder=/themepark" "${APP_FILEPATH}" || ! grep -q "WebUI\\\AlternativeUIEnabled=true" "${APP_FILEPATH}"; then - echo '-------------------------------------------------------' - echo '| Updating RootFolder and AlternativeUIEnabled values |' - echo '-------------------------------------------------------' - sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=true/g" "${APP_FILEPATH}"; - sed -i "s/WebUI\\\RootFolder=.*$/WebUI\\\RootFolder=\/themepark/g" "${APP_FILEPATH}"; -fi +#!/usr/bin/with-contenv bash + +echo '------------------------------' +echo '| qBittorrent theme.park Mod |' +echo '------------------------------' + +APP_FILEPATH='/config/qBittorrent/qBittorrent.conf' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/config/config/qBittorrent.conf' +fi + +# Backup config +if [[ ! -f "${APP_FILEPATH}.bak" ]]; then + echo "Creating qBittorrent.conf backup in /config." + cp -p ${APP_FILEPATH} "${APP_FILEPATH}.bak" +fi + +# Restore qBittorrent.conf +if [ "${TP_DISABLE_THEME}" = true ]; then + echo "Restoring backup of qBittorrent.conf" + sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=false/g" "${APP_FILEPATH}"; + exit 0 +fi + +if ! [[ -x "$(command -v svn)" ]]; then +echo '--------------------------' +echo '| Installing svn package |' +echo '--------------------------' + apt-get update && \ + apt-get install -y subversion +fi + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'APP_FILEPATH'=${APP_FILEPATH}\\n\ +'TP_DISABLE_THEME'=${TP_DISABLE_THEME}\\n\ +'TP_HOTIO'=${TP_HOTIO}\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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 + +# Downloading fresh webui files from source. +if [[ ! -d /themepark ]]; then + echo '---------------------------------------' + echo '| Downloading WebUI files from github |' + echo '---------------------------------------' + printf '\nDownloading qBittorrent webui to "/themepark"..please wait\n' + svn export --quiet https://github.com/qbittorrent/qBittorrent/trunk/src/webui/www /themepark + printf '\nDownload finished\n\n' + printf '\nDownloading qBittorrent webui icons to "/themepark/xxx"..please wait\n' + svn export --force --quiet https://github.com/qbittorrent/qBittorrent/trunk/src/icons /temp + cp -a /temp/. /themepark/public/icons + cp -a /temp/. /themepark/private/icons + rm -rf /temp + printf '\nDownload finished\n\n' +fi + +sed_file(){ + sed -i "s/<\/head>/<\/head> /g" $1 + sed -i "s/<\/head>/<\/head> /g" $1 + printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1" +} + +# Adding stylesheets +echo '---------------------------------------' +echo '| Adding the stylesheet to html files |' +echo '---------------------------------------' +if ! grep -q "${TP_DOMAIN}" /themepark/public/index.html; then + sed_file /themepark/public/index.html +fi + +if ! grep -q "${TP_DOMAIN}" /themepark/private/index.html; then + find ./themepark/private -type f -iname *.html | while read fname + do + sed_file $fname + done +fi + +if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then + echo '--------------------------------------' + echo '| Adding WebUI\RootFolder=/themepark |' + echo '--------------------------------------' + sed -i -e '$aWebUI\\RootFolder=/themepark' "${APP_FILEPATH}"; +fi + +if ! grep -q "WebUI\\\AlternativeUIEnabled" "${APP_FILEPATH}"; then + echo '------------------------------------------' + echo '| Adding WebUI\AlternativeUIEnabled=true |' + echo '------------------------------------------' + sed -i -e '$aWebUI\\AlternativeUIEnabled=true' "${APP_FILEPATH}"; +fi + +if ! grep -q "WebUI\\\RootFolder=/themepark" "${APP_FILEPATH}" || ! grep -q "WebUI\\\AlternativeUIEnabled=true" "${APP_FILEPATH}"; then + echo '-------------------------------------------------------' + echo '| Updating RootFolder and AlternativeUIEnabled values |' + echo '-------------------------------------------------------' + sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=true/g" "${APP_FILEPATH}"; + sed -i "s/WebUI\\\RootFolder=.*$/WebUI\\\RootFolder=\/themepark/g" "${APP_FILEPATH}"; +fi diff --git a/docker-mods/rutorrent/root/etc/cont-init.d/98-themepark b/docker-mods/rutorrent/root/etc/cont-init.d/98-themepark index df810a1b..0567c07a 100644 --- a/docker-mods/rutorrent/root/etc/cont-init.d/98-themepark +++ b/docker-mods/rutorrent/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '------------------------------' -echo '| Rutorrent theme.park Mod |' -echo '------------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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/rutorrent/index.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" /app/rutorrent/index.html - sed -i "s/<\/head>/<\/head> /g" /app/rutorrent/index.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '------------------------------' +echo '| Rutorrent theme.park Mod |' +echo '------------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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/rutorrent/index.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" /app/rutorrent/index.html + sed -i "s/<\/head>/<\/head> /g" /app/rutorrent/index.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/sabnzbd/root/etc/cont-init.d/98-themepark b/docker-mods/sabnzbd/root/etc/cont-init.d/98-themepark index 4edee99c..61871d9b 100644 --- a/docker-mods/sabnzbd/root/etc/cont-init.d/98-themepark +++ b/docker-mods/sabnzbd/root/etc/cont-init.d/98-themepark @@ -1,50 +1,50 @@ -#!/usr/bin/with-contenv bash - -echo '----------------------------' -echo '| SABnzbd theme.park Mod |' -echo '----------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -APP_FILEPATH='/app/sabnzbd' -if [ "${TP_HOTIO}" = true ]; then - echo 'Changing to Hotio file path!' - APP_FILEPATH='/app' -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}/interfaces/Glitter/templates/main.tmpl"; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Glitter/templates/main.tmpl" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/_inc_header_uc.tmpl" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/login/main.tmpl" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/wizard/inc_top.tmpl" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Glitter/templates/main.tmpl" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/_inc_header_uc.tmpl" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/login/main.tmpl" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/wizard/inc_top.tmpl" - printf 'Stylesheet set to %s\n' "${TP_THEME}" +#!/usr/bin/with-contenv bash + +echo '----------------------------' +echo '| SABnzbd theme.park Mod |' +echo '----------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +APP_FILEPATH='/app/sabnzbd' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/app' +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}/interfaces/Glitter/templates/main.tmpl"; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Glitter/templates/main.tmpl" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/_inc_header_uc.tmpl" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/login/main.tmpl" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/wizard/inc_top.tmpl" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Glitter/templates/main.tmpl" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/_inc_header_uc.tmpl" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/Config/templates/login/main.tmpl" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}/interfaces/wizard/inc_top.tmpl" + printf 'Stylesheet set to %s\n' "${TP_THEME}" fi \ No newline at end of file diff --git a/docker-mods/synclounge/root/etc/cont-init.d/98-themepark b/docker-mods/synclounge/root/etc/cont-init.d/98-themepark index 6b028e2b..e373ebc0 100644 --- a/docker-mods/synclounge/root/etc/cont-init.d/98-themepark +++ b/docker-mods/synclounge/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '-------------------------------' -echo '| Synclounge theme.park Mod |' -echo '-------------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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}" /usr/lib/node_modules/synclounge/dist/index.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/synclounge/dist/index.html - sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/synclounge/dist/index.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '-------------------------------' +echo '| Synclounge theme.park Mod |' +echo '-------------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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}" /usr/lib/node_modules/synclounge/dist/index.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/synclounge/dist/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/synclounge/dist/index.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/tautulli/root/etc/cont-init.d/98-themepark b/docker-mods/tautulli/root/etc/cont-init.d/98-themepark index ee292f5e..be378f8e 100644 --- a/docker-mods/tautulli/root/etc/cont-init.d/98-themepark +++ b/docker-mods/tautulli/root/etc/cont-init.d/98-themepark @@ -1,44 +1,44 @@ -#!/usr/bin/with-contenv bash - -echo '-----------------------------' -echo '| Tautulli theme.park Mod |' -echo '-----------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -APP_FILEPATH='/app/tautulli/data/interfaces/default/base.html' -if [ "${TP_HOTIO}" = true ]; then - echo 'Changing to Hotio file path!' - APP_FILEPATH='/app/data/interfaces/default/base.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}" - sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" - printf 'Stylesheet set to %s\n' "${TP_THEME}" +#!/usr/bin/with-contenv bash + +echo '-----------------------------' +echo '| Tautulli theme.park Mod |' +echo '-----------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +APP_FILEPATH='/app/tautulli/data/interfaces/default/base.html' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/app/data/interfaces/default/base.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}" + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + printf 'Stylesheet set to %s\n' "${TP_THEME}" fi \ No newline at end of file diff --git a/docker-mods/thelounge/root/etc/cont-init.d/98-themepark b/docker-mods/thelounge/root/etc/cont-init.d/98-themepark index a744626d..aeaf101d 100644 --- a/docker-mods/thelounge/root/etc/cont-init.d/98-themepark +++ b/docker-mods/thelounge/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '-------------------------------' -echo '| The Lounge theme.park Mod |' -echo '-------------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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}" /usr/lib/node_modules/thelounge/client/index.html.tpl; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/thelounge/client/index.html.tpl - sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/thelounge/client/index.html.tpl - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '-------------------------------' +echo '| The Lounge theme.park Mod |' +echo '-------------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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}" /usr/lib/node_modules/thelounge/client/index.html.tpl; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/thelounge/client/index.html.tpl + sed -i "s/<\/head>/<\/head> /g" /usr/lib/node_modules/thelounge/client/index.html.tpl + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/transmission/root/etc/cont-init.d/98-themepark b/docker-mods/transmission/root/etc/cont-init.d/98-themepark index 235808d9..2ec8b98a 100644 --- a/docker-mods/transmission/root/etc/cont-init.d/98-themepark +++ b/docker-mods/transmission/root/etc/cont-init.d/98-themepark @@ -1,39 +1,39 @@ -#!/usr/bin/with-contenv bash - -echo '---------------------------------' -echo '| Transmission theme.park Mod |' -echo '---------------------------------' - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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}" /usr/share/transmission/web/index.html; then - echo '---------------------------' - echo '| Adding the stylesheet |' - echo '---------------------------' - sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html - sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html - printf 'Stylesheet set to %s\n' "${TP_THEME} - " +#!/usr/bin/with-contenv bash + +echo '---------------------------------' +echo '| Transmission theme.park Mod |' +echo '---------------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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}" /usr/share/transmission/web/index.html; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html + sed -i "s/<\/head>/<\/head> /g" /usr/share/transmission/web/index.html + printf 'Stylesheet set to %s\n' "${TP_THEME} + " fi \ No newline at end of file diff --git a/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark b/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark index a2a0a12c..8ca812cd 100644 --- a/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark +++ b/docker-mods/vuetorrent/root/etc/cont-init.d/98-themepark @@ -1,133 +1,133 @@ -#!/usr/bin/with-contenv bash -APP_FILEPATH='/config/qBittorrent/qBittorrent.conf' -INDEX_FILEPATH='/vuetorrent/public/index.html' -if [ "${TP_HOTIO}" = true ]; then - echo 'Changing to Hotio file paths!' - APP_FILEPATH='/config/config/qBittorrent.conf' - INDEX_FILEPATH='/app/vuetorrent/public/index.html' -fi - -# Backup config -if [[ ! -f "${APP_FILEPATH}.bak" ]]; then - echo "Creating qBittorrent.conf backup in /config." - cp -p ${APP_FILEPATH} "${APP_FILEPATH}.bak" -fi - -# Restore qBittorrent.conf -if [ "${TP_DISABLE_THEME}" = true ]; then - echo "Restoring backup of qBittorrent.conf" - sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=false/g" "${APP_FILEPATH}"; - exit 0 -fi - -# Display variables for troubleshooting -echo -e "Variables set:\\n\ -'TP_DOMAIN'=${TP_DOMAIN}\\n\ -'TP_THEME'=${TP_THEME}\\n" - -# 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 -RELEASE_FILEPATH='/vuetorrent/release.json' -NEEDS_UPDATE=false -CURRENT_RELEASE=$(curl -s https://api.github.com/repos/WDaan/VueTorrent/releases/latest | jq -r ".assets[]") - -# =============================================== -install_deps() { - if ! [[ -x "$(command -v jq)" ]]; then - echo '-------------------------' - echo '| Installing jq package |' - echo '-------------------------' - apt-get update && - apt-get install -y jq - fi -} -check_updates() { - if [[ ! -d ./vuetorrent ]]; then - NEEDS_UPDATE=true - elif [[ ! -f $RELEASE_FILEPATH ]]; then - NEEDS_UPDATE=true - else - old_date=$(date -d $(cat "${RELEASE_FILEPATH}" | jq -r ".updated_at") +%s) - new_date=$(date -d $(echo $CURRENT_RELEASE | jq -r ".updated_at") +%s) - if [ $new_date -gt $old_date ]; then - NEEDS_UPDATE=true - fi - fi -} -update_ui() { - printf '\nDownloading qBittorrent webui to "/vuetorrent"..please wait\n' - curl -L $(echo $CURRENT_RELEASE | jq -r ".browser_download_url") --output /tmp/vuetorrent.zip - printf '\nDownload finished\n\n' - if [[ -d /vuetorrent ]]; then - rm -rf /vuetorrent - fi - # mkdir -p /vuetorrent - unzip -q /tmp/vuetorrent.zip -d / - echo $CURRENT_RELEASE >"${RELEASE_FILEPATH}" -} -# =============================================== - -echo '-----------------------------------------' -echo '| qBittorrent vuetorrent theme.park Mod |' -echo '-----------------------------------------' - -if [[ -z ${TP_HOTIO} ]]; then - install_deps - check_updates - - if [ "$NEEDS_UPDATE" = true ]; then - echo '---------------------------------------' - echo '| Downloading WebUI files from github |' - echo '---------------------------------------' - update_ui - else - echo ' WebUI files are up-to-date!' - fi - - if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then - echo '--------------------------------------' - echo '| Adding WebUI\RootFolder=/vuetorrent |' - echo '--------------------------------------' - sed -i -e '$aWebUI\\RootFolder=/vuetorrent' "${APP_FILEPATH}" - fi - - if ! grep -q "WebUI\\\AlternativeUIEnabled" "${APP_FILEPATH}"; then - echo '------------------------------------------' - echo '| Adding WebUI\AlternativeUIEnabled=true |' - echo '------------------------------------------' - sed -i -e '$aWebUI\\AlternativeUIEnabled=true' "${APP_FILEPATH}" - fi - - if ! grep -q "WebUI\\\RootFolder=/vuetorrent" "${APP_FILEPATH}" || ! grep -q "WebUI\\\AlternativeUIEnabled=true" "${APP_FILEPATH}"; then - echo '-------------------------------------------------------' - echo '| Updating RootFolder and AlternativeUIEnabled values |' - echo '-------------------------------------------------------' - sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=true/g" "${APP_FILEPATH}" - sed -i "s/WebUI\\\RootFolder=.*$/WebUI\\\RootFolder=\/vuetorrent/g" "${APP_FILEPATH}" - fi -fi - -# Adding stylesheets -if ! grep -q "${TP_DOMAIN}" "${INDEX_FILEPATH}"; then - echo '---------------------------------------------------------' - echo '| Adding the stylesheet to /vuetorrent/public/index.html |' - echo '---------------------------------------------------------' - sed -i "s/<\/body>/<\/body> /g" "${INDEX_FILEPATH}" - sed -i "s/<\/body>/<\/body> /g" "${INDEX_FILEPATH}" - printf 'Stylesheet set to %s on public index.html\n' "${TP_THEME}" +#!/usr/bin/with-contenv bash +APP_FILEPATH='/config/qBittorrent/qBittorrent.conf' +INDEX_FILEPATH='/vuetorrent/public/index.html' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file paths!' + APP_FILEPATH='/config/config/qBittorrent.conf' + INDEX_FILEPATH='/app/vuetorrent/public/index.html' +fi + +# Backup config +if [[ ! -f "${APP_FILEPATH}.bak" ]]; then + echo "Creating qBittorrent.conf backup in /config." + cp -p ${APP_FILEPATH} "${APP_FILEPATH}.bak" +fi + +# Restore qBittorrent.conf +if [ "${TP_DISABLE_THEME}" = true ]; then + echo "Restoring backup of qBittorrent.conf" + sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=false/g" "${APP_FILEPATH}"; + exit 0 +fi + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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 +RELEASE_FILEPATH='/vuetorrent/release.json' +NEEDS_UPDATE=false +CURRENT_RELEASE=$(curl -s https://api.github.com/repos/WDaan/VueTorrent/releases/latest | jq -r ".assets[]") + +# =============================================== +install_deps() { + if ! [[ -x "$(command -v jq)" ]]; then + echo '-------------------------' + echo '| Installing jq package |' + echo '-------------------------' + apt-get update && + apt-get install -y jq + fi +} +check_updates() { + if [[ ! -d ./vuetorrent ]]; then + NEEDS_UPDATE=true + elif [[ ! -f $RELEASE_FILEPATH ]]; then + NEEDS_UPDATE=true + else + old_date=$(date -d $(cat "${RELEASE_FILEPATH}" | jq -r ".updated_at") +%s) + new_date=$(date -d $(echo $CURRENT_RELEASE | jq -r ".updated_at") +%s) + if [ $new_date -gt $old_date ]; then + NEEDS_UPDATE=true + fi + fi +} +update_ui() { + printf '\nDownloading qBittorrent webui to "/vuetorrent"..please wait\n' + curl -L $(echo $CURRENT_RELEASE | jq -r ".browser_download_url") --output /tmp/vuetorrent.zip + printf '\nDownload finished\n\n' + if [[ -d /vuetorrent ]]; then + rm -rf /vuetorrent + fi + # mkdir -p /vuetorrent + unzip -q /tmp/vuetorrent.zip -d / + echo $CURRENT_RELEASE >"${RELEASE_FILEPATH}" +} +# =============================================== + +echo '-----------------------------------------' +echo '| qBittorrent vuetorrent theme.park Mod |' +echo '-----------------------------------------' + +if [[ -z ${TP_HOTIO} ]]; then + install_deps + check_updates + + if [ "$NEEDS_UPDATE" = true ]; then + echo '---------------------------------------' + echo '| Downloading WebUI files from github |' + echo '---------------------------------------' + update_ui + else + echo ' WebUI files are up-to-date!' + fi + + if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then + echo '--------------------------------------' + echo '| Adding WebUI\RootFolder=/vuetorrent |' + echo '--------------------------------------' + sed -i -e '$aWebUI\\RootFolder=/vuetorrent' "${APP_FILEPATH}" + fi + + if ! grep -q "WebUI\\\AlternativeUIEnabled" "${APP_FILEPATH}"; then + echo '------------------------------------------' + echo '| Adding WebUI\AlternativeUIEnabled=true |' + echo '------------------------------------------' + sed -i -e '$aWebUI\\AlternativeUIEnabled=true' "${APP_FILEPATH}" + fi + + if ! grep -q "WebUI\\\RootFolder=/vuetorrent" "${APP_FILEPATH}" || ! grep -q "WebUI\\\AlternativeUIEnabled=true" "${APP_FILEPATH}"; then + echo '-------------------------------------------------------' + echo '| Updating RootFolder and AlternativeUIEnabled values |' + echo '-------------------------------------------------------' + sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=true/g" "${APP_FILEPATH}" + sed -i "s/WebUI\\\RootFolder=.*$/WebUI\\\RootFolder=\/vuetorrent/g" "${APP_FILEPATH}" + fi +fi + +# Adding stylesheets +if ! grep -q "${TP_DOMAIN}" "${INDEX_FILEPATH}"; then + echo '---------------------------------------------------------' + echo '| Adding the stylesheet to /vuetorrent/public/index.html |' + echo '---------------------------------------------------------' + sed -i "s/<\/body>/<\/body> /g" "${INDEX_FILEPATH}" + sed -i "s/<\/body>/<\/body> /g" "${INDEX_FILEPATH}" + printf 'Stylesheet set to %s on public index.html\n' "${TP_THEME}" fi \ No newline at end of file