From f7a39e9b6ed5c505ade0702a277b53c2fcafedcc Mon Sep 17 00:00:00 2001
From: gilbN <24592972+gilbN@users.noreply.github.com>
Date: Tue, 15 Dec 2020 21:36:36 +0100
Subject: [PATCH] bazarr, lidarr, readarr mods
---
bazarr/Dockerfile | 4 +++
bazarr/root/etc/cont-init.d/98-themepark | 31 +++++++++++++++++++++++
lidarr/Dockerfile | 4 +++
lidarr/root/etc/cont-init.d/98-themepark | 31 +++++++++++++++++++++++
radarr/root/etc/cont-init.d/98-themepark | 3 ++-
readarr/Dockerfile | 4 +++
readarr/root/etc/cont-init.d/98-themepark | 31 +++++++++++++++++++++++
sonarr/root/etc/cont-init.d/98-themepark | 3 ++-
8 files changed, 109 insertions(+), 2 deletions(-)
create mode 100644 bazarr/Dockerfile
create mode 100644 bazarr/root/etc/cont-init.d/98-themepark
create mode 100644 lidarr/Dockerfile
create mode 100644 lidarr/root/etc/cont-init.d/98-themepark
create mode 100644 readarr/Dockerfile
create mode 100644 readarr/root/etc/cont-init.d/98-themepark
diff --git a/bazarr/Dockerfile b/bazarr/Dockerfile
new file mode 100644
index 00000000..faefca3a
--- /dev/null
+++ b/bazarr/Dockerfile
@@ -0,0 +1,4 @@
+FROM scratch
+
+# copy local files
+COPY root/ /
\ No newline at end of file
diff --git a/bazarr/root/etc/cont-init.d/98-themepark b/bazarr/root/etc/cont-init.d/98-themepark
new file mode 100644
index 00000000..4e810743
--- /dev/null
+++ b/bazarr/root/etc/cont-init.d/98-themepark
@@ -0,0 +1,31 @@
+#!/usr/bin/with-contenv bash
+
+echo '---------------------------'
+echo '| Bazarr 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 gilbn.github.io'
+ TP_DOMAIN='gilbn.github.io'
+fi
+
+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/bazarr/views/_main.html; then
+ echo '---------------------------'
+ echo '| Adding the stylesheet |'
+ echo '---------------------------'
+ sed -i "s/<\/head>/<\/head> /g" /app/bazarr/views/_main.html
+ printf 'Stylesheet set to %s\n' "${TP_THEME}
+ "
+fi
\ No newline at end of file
diff --git a/lidarr/Dockerfile b/lidarr/Dockerfile
new file mode 100644
index 00000000..faefca3a
--- /dev/null
+++ b/lidarr/Dockerfile
@@ -0,0 +1,4 @@
+FROM scratch
+
+# copy local files
+COPY root/ /
\ No newline at end of file
diff --git a/lidarr/root/etc/cont-init.d/98-themepark b/lidarr/root/etc/cont-init.d/98-themepark
new file mode 100644
index 00000000..d10e644d
--- /dev/null
+++ b/lidarr/root/etc/cont-init.d/98-themepark
@@ -0,0 +1,31 @@
+#!/usr/bin/with-contenv bash
+
+echo '---------------------------'
+echo '| Lidarr 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 gilbn.github.io'
+ TP_DOMAIN='gilbn.github.io'
+fi
+
+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/lidarr/bin/UI/index.html; then
+ echo '---------------------------'
+ echo '| Adding the stylesheet |'
+ echo '---------------------------'
+ sed -i "s/<\/head>/<\/head> /g" /app/lidarr/bin/UI/index.html
+ printf 'Stylesheet set to %s\n' "${TP_THEME}
+ "
+fi
\ No newline at end of file
diff --git a/radarr/root/etc/cont-init.d/98-themepark b/radarr/root/etc/cont-init.d/98-themepark
index 2923f606..d8c9646d 100644
--- a/radarr/root/etc/cont-init.d/98-themepark
+++ b/radarr/root/etc/cont-init.d/98-themepark
@@ -26,5 +26,6 @@ if ! grep -q "${TP_DOMAIN}" /app/radarr/bin/UI/index.html; then
echo '| Adding the stylesheet |'
echo '---------------------------'
sed -i "s/<\/head>/<\/head> /g" /app/radarr/bin/UI/index.html
- printf 'Stylesheet set to %s\n' "${TP_THEME}"
+ printf 'Stylesheet set to %s\n' "${TP_THEME}
+ "
fi
\ No newline at end of file
diff --git a/readarr/Dockerfile b/readarr/Dockerfile
new file mode 100644
index 00000000..faefca3a
--- /dev/null
+++ b/readarr/Dockerfile
@@ -0,0 +1,4 @@
+FROM scratch
+
+# copy local files
+COPY root/ /
\ No newline at end of file
diff --git a/readarr/root/etc/cont-init.d/98-themepark b/readarr/root/etc/cont-init.d/98-themepark
new file mode 100644
index 00000000..489b14c8
--- /dev/null
+++ b/readarr/root/etc/cont-init.d/98-themepark
@@ -0,0 +1,31 @@
+#!/usr/bin/with-contenv bash
+
+echo '---------------------------'
+echo '| Readarr 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 gilbn.github.io'
+ TP_DOMAIN='gilbn.github.io'
+fi
+
+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/bin/UI/index.html; then
+ echo '---------------------------'
+ echo '| Adding the stylesheet |'
+ echo '---------------------------'
+ sed -i "s/<\/head>/<\/head> /g" /app/bin/UI/index.html
+ printf 'Stylesheet set to %s\n' "${TP_THEME}
+ "
+fi
\ No newline at end of file
diff --git a/sonarr/root/etc/cont-init.d/98-themepark b/sonarr/root/etc/cont-init.d/98-themepark
index 2defe05d..8c3877e9 100644
--- a/sonarr/root/etc/cont-init.d/98-themepark
+++ b/sonarr/root/etc/cont-init.d/98-themepark
@@ -26,5 +26,6 @@ if ! grep -q "${TP_DOMAIN}" /app/sonarr/bin/UI/index.html; then
echo '| Adding the stylesheet |'
echo '---------------------------'
sed -i "s/<\/head>/<\/head> /g" /app/sonarr/bin/UI/index.html
- printf 'Stylesheet set to %s\n' "${TP_THEME}"
+ printf 'Stylesheet set to %s\n' "${TP_THEME}
+ "
fi
\ No newline at end of file