Skip to content

Commit

Permalink
nc-restore: check validity of backup file
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Jan 7, 2018
1 parent 614c57d commit 0587ca3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions etc/nextcloudpi-config.d/nc-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down

0 comments on commit 0587ca3

Please sign in to comment.