From 6aa2647df330fdd8bdf8865eeff860642ea09d5c Mon Sep 17 00:00:00 2001 From: GilbN Date: Tue, 20 Dec 2022 19:42:15 +0100 Subject: [PATCH] Qbittorrent mod: Add clean file note --- .../root/etc/cont-init.d/98-themepark | 31 ++++++++++--------- .../s6-overlay/s6-rc.d/init-mod-themepark/run | 31 ++++++++++--------- 2 files changed, 32 insertions(+), 30 deletions(-) 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 53432d94..dc6916b5 100755 --- a/docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark +++ b/docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark @@ -97,34 +97,35 @@ sed_file(){ printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1" } -clean_html() { +clean_file() { perl -i -pe 's/QBT_TR?\(//' "$1" perl -i -pe 's/\)QBT_TR\[CONTEXT=.*?\]//' "$1" } -# Adding stylesheets -echo '---------------------------------------' -echo '| Adding the stylesheet to html files |' -echo '---------------------------------------' if ! grep -q "${TP_DOMAIN}/css/base" /themepark/public/index.html; then + # Adding stylesheets + echo '---------------------------------------' + echo '| Adding the stylesheet to html files |' + echo '---------------------------------------' sed_file /themepark/public/index.html - clean_html /themepark/public/index.html + clean_file /themepark/public/index.html - # Clean JS files - find /themepark -type f -iname "*.js" | while read fname - do - clean_html $fname - done -fi - -if ! grep -q "${TP_DOMAIN}/css/base" /themepark/private/index.html; then find /themepark/private -type f -iname "*.html" | while read fname do sed_file $fname - clean_html $fname done fi +# Clean all files +printf 'Cleaning files in /themepark for any translation text...\n\n +-------------------------------------------------------------------------- +| !!! RESTART THE CONTAINER IF THIS IS THE FIRST TIME CLEANING FILES !!! | +--------------------------------------------------------------------------\n\n' +find /themepark -type f \( ! -iname "*.svg" \) | while read fname +do + clean_file $fname +done + if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then echo '--------------------------------------' echo '| Adding WebUI\RootFolder=/themepark |' diff --git a/docker-mods/qbittorrent/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/qbittorrent/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index 091c7367..0d884081 100755 --- a/docker-mods/qbittorrent/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/qbittorrent/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -82,34 +82,35 @@ sed_file(){ printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1" } -clean_html() { +clean_file() { perl -i -pe 's/QBT_TR?\(//' "$1" perl -i -pe 's/\)QBT_TR\[CONTEXT=.*?\]//' "$1" } -# Adding stylesheets -echo '---------------------------------------' -echo '| Adding the stylesheet to html files |' -echo '---------------------------------------' if ! grep -q "${TP_DOMAIN}/css/base" /themepark/public/index.html; then + # Adding stylesheets + echo '---------------------------------------' + echo '| Adding the stylesheet to html files |' + echo '---------------------------------------' sed_file /themepark/public/index.html - clean_html /themepark/public/index.html + clean_file /themepark/public/index.html - # Clean JS files - find /themepark -type f -iname "*.js" | while read fname - do - clean_html $fname - done -fi - -if ! grep -q "${TP_DOMAIN}/css/base" /themepark/private/index.html; then find /themepark/private -type f -iname "*.html" | while read fname do sed_file $fname - clean_html $fname done fi +# Clean all files +printf 'Cleaning files in /themepark for any translation text...\n\n +-------------------------------------------------------------------------- +| !!! RESTART THE CONTAINER IF THIS IS THE FIRST TIME CLEANING FILES !!! | +--------------------------------------------------------------------------\n\n' +find /themepark -type f \( ! -iname "*.svg" \) | while read fname +do + clean_file $fname +done + if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then echo '--------------------------------------' echo '| Adding WebUI\RootFolder=/themepark |'