From 88c286f14095c4e3f7eaac1e60759659f668c2ef Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 17 Jan 2022 02:25:12 +0100 Subject: [PATCH] [fix] Avoid twice upload dir --- scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 2 ++ 3 files changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index ccff4b9..0647a84 100755 --- a/scripts/install +++ b/scripts/install @@ -123,6 +123,7 @@ mkdir -p $datadir rmdir $datadir && mv "$final_path/upload" $datadir || true chown -R $app:www-data "$datadir" chmod -R o-rwx "$datadir" +ln -s $datadir $final_path/upload 2> /dev/null || true #================================================= # CONFIGURE diff --git a/scripts/restore b/scripts/restore index 449bd32..e49088d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -111,6 +111,7 @@ ynh_restore_file --origin_path="$datadir" --not_mandatory mkdir -p "$datadir" chown -R $app:www-data "$datadir" chmod -R o-rwx "$datadir" +ln -s $datadir $final_path/upload 2> /dev/null || true #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index d7e4ebe..1d29bc2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,6 +73,7 @@ if [ -z "$datadir" ]; then rmdir $datadir && mv "$final_path/upload" $datadir || true chown -R $app:www-data "$datadir" chmod -R o-rwx "$datadir" + ln -s $datadir $final_path/upload fi # Cleaning legacy permissions @@ -121,6 +122,7 @@ chmod 750 "$final_path/tmp" chmod 750 "$final_path/application/config/" chown -R $app:www-data "$datadir" chmod 750 $datadir +ln -s $datadir $final_path/upload 2> /dev/null || true #================================================= # NGINX CONFIGURATION