From 83ced15ce6d546ca323ed99013c7e7b0d3513412 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:51:38 +0100 Subject: [PATCH] Update 99-run.sh --- paperless_ngx/rootfs/etc/cont-init.d/99-run.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh b/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh index 5d376d107..da3b69a5e 100755 --- a/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh +++ b/paperless_ngx/rootfs/etc/cont-init.d/99-run.sh @@ -87,17 +87,20 @@ for variable in PAPERLESS_DATA_DIR PAPERLESS_MEDIA_ROOT PAPERLESS_CONSUMPTION_DI variablecontent="$(eval echo "\$$variable")" # Sanitize " ' ` in current variable variablecontent="${variablecontent//[\"\'\`]/}" - bashio::log.blue "$variable=\"$variablecontent\"" + if [[ $variablecontent = *" "* ]]; then + variablecontent="'$variablecontent'" + fi + bashio::log.blue "$variable=$variablecontent" # Export - export "$variable=\"$variablecontent\"" + export "$variable=$variablecontent" # Add to bashrc - eval echo "$variable=\"$variablecontent\"" >> ~/.bashrc + eval echo "$variable=$variablecontent" >> ~/.bashrc # set .env - echo "$variable=\"$variablecontent\"" >> /.env || true + echo "$variable=$variablecontent" >> /.env || true # set /etc/environment mkdir -p /etc - echo "$variable=\"$variablecontent\"" >> /etc/environment + echo "$variable=$variablecontent" >> /etc/environment # For s6 if [ -d /var/run/s6/container_environment ]; then printf "%s" "${variablecontent}" > /var/run/s6/container_environment/"${variable}"; fi done