aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-09-23 11:13:48 +0200
committerGravatar GitHub <noreply@github.com> 2024-09-23 11:13:48 +0200
commit1207236e9c297ecea206a07c3b54e9e4f01cdd7a (patch)
tree390cc33ffe347daa26610e00dc52350e3f4c312a
parentecd67e2178679f5da9cb69dc3996724b0c67bca7 (diff)
Docker entrypoint optimize find sed (#6827)
Single `find` and single `sed` command instead of 3
-rwxr-xr-xDocker/entrypoint.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.sh
index bf250840a..38006ca6f 100755
--- a/Docker/entrypoint.sh
+++ b/Docker/entrypoint.sh
@@ -3,9 +3,10 @@
ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime
echo "$TZ" >/etc/timezone
-find /etc/php*/ -type f -name php.ini -exec sed -r -i "\\#^;?date.timezone#s#^.*#date.timezone = $TZ#" {} \;
-find /etc/php*/ -type f -name php.ini -exec sed -r -i "\\#^;?post_max_size#s#^.*#post_max_size = 32M#" {} \;
-find /etc/php*/ -type f -name php.ini -exec sed -r -i "\\#^;?upload_max_filesize#s#^.*#upload_max_filesize = 32M#" {} \;
+find /etc/php*/ -type f -name php.ini -exec sed -i -E \
+ -e "\\#^;?date.timezone#s#^.*#date.timezone = $TZ#" \
+ -e "\\#^;?post_max_size#s#^.*#post_max_size = 32M#" \
+ -e "\\#^;?upload_max_filesize#s#^.*#upload_max_filesize = 32M#" {} \;
if [ -n "$LISTEN" ]; then
find /etc/apache2/ -type f -name FreshRSS.Apache.conf -exec sed -r -i "\\#^Listen#s#^.*#Listen $LISTEN#" {} \;