diff options
-rw-r--r-- | etc/nextcloudpi-config.d/nc-restore.sh | 6 |
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..." |