Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'etc/nextcloudpi-config.d/nc-restore.sh')
-rw-r--r--etc/nextcloudpi-config.d/nc-restore.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh
index fc2033d7..fd21846d 100644
--- a/etc/nextcloudpi-config.d/nc-restore.sh
+++ b/etc/nextcloudpi-config.d/nc-restore.sh
@@ -95,11 +95,18 @@ EOF
[[ -e "$DATADIR" ]] && {
echo "backing up existing $DATADIR"
- mv "$DATADIR" "$DATADIR-$( date "+%m-%d-%y" )"
+ mv "$DATADIR" "$DATADIR-$( date "+%m-%d-%y" )" || return 1
}
- mkdir -p "$( dirname "$DATADIR" )"
- mv "$TMPDIR/$( basename "$DATADIR" )" "$DATADIR"
+ mkdir -p "$DATADIR"
+ [[ "$( stat -fc%T "$DATADIR" )" == "btrfs" ]] && {
+ rmdir "$DATADIR" || return 1
+ btrfs subvolume create "$DATADIR" || return 1
+ }
+ chown www-data:www-data "$DATADIR"
+ local TMPDATA="$TMPDIR/$( basename "$DATADIR" )"
+ mv "$TMPDATA"/* "$TMPDATA"/.[!.]* "$DATADIR" || return 1
+ rmdir "$TMPDATA" || return 1
sudo -u www-data php occ maintenance:mode --off