Skip to content

Commit 6aa2647

Browse files
committed
Qbittorrent mod: Add clean file note
1 parent 6c07a6f commit 6aa2647

File tree

2 files changed

+32
-30
lines changed
  • docker-mods/qbittorrent/root/etc

2 files changed

+32
-30
lines changed

Diff for: docker-mods/qbittorrent/root/etc/cont-init.d/98-themepark

+16-15
Original file line numberDiff line numberDiff line change
@@ -97,34 +97,35 @@ sed_file(){
9797
printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1"
9898
}
9999

100-
clean_html() {
100+
clean_file() {
101101
perl -i -pe 's/QBT_TR?\(//' "$1"
102102
perl -i -pe 's/\)QBT_TR\[CONTEXT=.*?\]//' "$1"
103103
}
104104

105-
# Adding stylesheets
106-
echo '---------------------------------------'
107-
echo '| Adding the stylesheet to html files |'
108-
echo '---------------------------------------'
109105
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/public/index.html; then
106+
# Adding stylesheets
107+
echo '---------------------------------------'
108+
echo '| Adding the stylesheet to html files |'
109+
echo '---------------------------------------'
110110
sed_file /themepark/public/index.html
111-
clean_html /themepark/public/index.html
111+
clean_file /themepark/public/index.html
112112

113-
# Clean JS files
114-
find /themepark -type f -iname "*.js" | while read fname
115-
do
116-
clean_html $fname
117-
done
118-
fi
119-
120-
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/private/index.html; then
121113
find /themepark/private -type f -iname "*.html" | while read fname
122114
do
123115
sed_file $fname
124-
clean_html $fname
125116
done
126117
fi
127118

119+
# Clean all files
120+
printf 'Cleaning files in /themepark for any translation text...\n\n
121+
--------------------------------------------------------------------------
122+
| !!! RESTART THE CONTAINER IF THIS IS THE FIRST TIME CLEANING FILES !!! |
123+
--------------------------------------------------------------------------\n\n'
124+
find /themepark -type f \( ! -iname "*.svg" \) | while read fname
125+
do
126+
clean_file $fname
127+
done
128+
128129
if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then
129130
echo '--------------------------------------'
130131
echo '| Adding WebUI\RootFolder=/themepark |'

Diff for: docker-mods/qbittorrent/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run

+16-15
Original file line numberDiff line numberDiff line change
@@ -82,34 +82,35 @@ sed_file(){
8282
printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1"
8383
}
8484

85-
clean_html() {
85+
clean_file() {
8686
perl -i -pe 's/QBT_TR?\(//' "$1"
8787
perl -i -pe 's/\)QBT_TR\[CONTEXT=.*?\]//' "$1"
8888
}
8989

90-
# Adding stylesheets
91-
echo '---------------------------------------'
92-
echo '| Adding the stylesheet to html files |'
93-
echo '---------------------------------------'
9490
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/public/index.html; then
91+
# Adding stylesheets
92+
echo '---------------------------------------'
93+
echo '| Adding the stylesheet to html files |'
94+
echo '---------------------------------------'
9595
sed_file /themepark/public/index.html
96-
clean_html /themepark/public/index.html
96+
clean_file /themepark/public/index.html
9797

98-
# Clean JS files
99-
find /themepark -type f -iname "*.js" | while read fname
100-
do
101-
clean_html $fname
102-
done
103-
fi
104-
105-
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/private/index.html; then
10698
find /themepark/private -type f -iname "*.html" | while read fname
10799
do
108100
sed_file $fname
109-
clean_html $fname
110101
done
111102
fi
112103

104+
# Clean all files
105+
printf 'Cleaning files in /themepark for any translation text...\n\n
106+
--------------------------------------------------------------------------
107+
| !!! RESTART THE CONTAINER IF THIS IS THE FIRST TIME CLEANING FILES !!! |
108+
--------------------------------------------------------------------------\n\n'
109+
find /themepark -type f \( ! -iname "*.svg" \) | while read fname
110+
do
111+
clean_file $fname
112+
done
113+
113114
if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then
114115
echo '--------------------------------------'
115116
echo '| Adding WebUI\RootFolder=/themepark |'

0 commit comments

Comments
 (0)