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:
-rw-r--r--etc/nextcloudpi-config.d/nc-restore.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh
index b24b5d0b..bb856ebb 100644
--- a/etc/nextcloudpi-config.d/nc-restore.sh
+++ b/etc/nextcloudpi-config.d/nc-restore.sh
@@ -50,6 +50,12 @@ configure()
echo "extracting backup file $BACKUPFILE_..."
tar -xf "$BACKUPFILE_" -C "$TMPDIR" || return 1
+ ## SANITY CHECKS
+ [[ -d "$TMPDIR"/nextcloud ]] && [[ -f "$( ls "$TMPDIR"/nextcloud-sqlbkp_*.bak 2>/dev/null )" ]] || {
+ echo "invalid backup file. Abort"
+ return 1
+ }
+
## RESTORE FILES
echo "restore files..."