From dfe6bd5ff0e6b775eb77081661d143b1d6eeecef Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 26 Jun 2023 15:14:33 +0200 Subject: [PATCH] revert adjustment of tempdirectory Signed-off-by: Simon L --- Containers/nextcloud/entrypoint.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index 003ae2c6372..3995ed3e115 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -444,12 +444,14 @@ if [ -z "$OBJECTSTORE_S3_BUCKET" ] && [ -z "$OBJECTSTORE_SWIFT_URL" ]; then exit 1 fi - # Configure tempdirectory - mkdir -p "$NEXTCLOUD_DATA_DIR/tmp/" - if ! grep -q upload_tmp_dir /usr/local/etc/php/conf.d/nextcloud.ini; then - echo "upload_tmp_dir = $NEXTCLOUD_DATA_DIR/tmp/" >> /usr/local/etc/php/conf.d/nextcloud.ini + # Delete formerly configured tempdirectory as the default is usually faster (if the datadir is on a HDD or network FS) + if [ "$(php /var/www/html/occ config:system:get tempdirectory)" = "$NEXTCLOUD_DATA_DIR/tmp/" ]; then + php /var/www/html/occ config:system:delete tempdirectory + if [ -d "$NEXTCLOUD_DATA_DIR/tmp/" ]; then + rm -r "$NEXTCLOUD_DATA_DIR/tmp/" + fi fi - php /var/www/html/occ config:system:set tempdirectory --value="$NEXTCLOUD_DATA_DIR/tmp/" + fi # Perform fingerprint update if instance was restored