From f3e9b2bd8217737af0879c35de282876d6c7e046 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 31 Aug 2021 15:57:04 +0200 Subject: [PATCH] Update 21-folders --- piwigo/rootfs/etc/cont-init.d/21-folders | 38 ++++++++++-------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/piwigo/rootfs/etc/cont-init.d/21-folders b/piwigo/rootfs/etc/cont-init.d/21-folders index 2e50e284f..05283a57c 100644 --- a/piwigo/rootfs/etc/cont-init.d/21-folders +++ b/piwigo/rootfs/etc/cont-init.d/21-folders @@ -1,14 +1,11 @@ #!/usr/bin/with-contenv bash -################## -# CORRECT CONFIG # -################## -sed -i "s|$conf['show_php_errors'] = E_ALL;|$conf['show_php_errors'] = E_ALL & ~E_NOTICE & ~E_DEPRECATED;|g" /gallery/local/config/config.inc.php && echo "config corrected for php error" || true - ################## # SYMLINK CONFIG # ################## +#Create folders + if [ ! -d /share/piwigo ]; then echo "Creating /share/piwigo" mkdir -p /share/piwigo @@ -17,26 +14,21 @@ else chown -R abc:abc /share/piwigo fi -# If config doesn't exist, create it if [ ! -d /share/piwigo/config ]; then - echo "moving config folder" - mv /gallery/local/config /share/piwigo - ln -s /share/piwigo/config /gallery/local - echo "links done" -else - rm /gallery/local/config - ln -s /share/piwigo/config /gallery/local - echo "Using existing config" + echo "Creating /share/piwigo/config + mkdir -p /share/piwigo/config + chown -R abc:abc /share/piwigo/config fi -# If keys don't exist, create it if [ ! -d /share/piwigo/keys ]; then - echo "moving keys folder" - mv /config/keys /share/piwigo - ln -s /share/piwigo/keys /config - echo "links done" -else - rm /config/keys - ln -s /share/piwigo/keys /config - echo "Using existing keys folder" + echo "Creating /share/piwigo/keys + mkdir -p /share/piwigo/keys + chown -R abc:abc /share/piwigo/keys fi + +# Create symlinks + +echo "Symlink config" +ln -s /share/piwigo/config /gallery/local || mkdir /gallery/local/config & ln -s /share/piwigo/config /gallery/local +echo "Symlink keys" +ln -s /share/piwigo/config /config/keys || mkdir /config/keys & ln -s /share/piwigo/config /config/keys