diff --git a/tools/mount-vault b/tools/mount-vault index 685149ff..2dd5183e 100755 --- a/tools/mount-vault +++ b/tools/mount-vault @@ -2,7 +2,10 @@ set -e echo "decrypting..." -gpg2 -d ~/Nextcloud/vault.zip.gpg > ~/.vault.zip +cp -v ~/Nextcloud/vault.zip.gpg ~/.vault.zip.gpg +cp -v ~/Nextcloud/vault.zip.gpg.sha512 ~/.vault.zip.gpg.sha512 +sha512sum -c ~/.vault.zip.gpg.sha512 +gpg2 -d ~/.vault.zip.gpg > ~/.vault.zip echo "mounting..." mkdir -p ~/.vault archivemount -o nobackup ~/.vault.zip ~/.vault diff --git a/tools/umount-vault b/tools/umount-vault index 56da2175..5f6a9212 100755 --- a/tools/umount-vault +++ b/tools/umount-vault @@ -1,8 +1,16 @@ #!/bin/bash set -e +echo "Unmounting vault.." sudo umount ~/.vault +echo "Encrypting archive..." gpg2 -c ~/.vault.zip +echo "Calculating checksum..." +sha512sum ~/.vault.zip.gpg > ~/.vault.zip.gpg.sha512 +sha512sum -c ~/.vault.zip.gpg.sha512 +cat ~/.vault.zip.gpg.sha512 +echo "Moving vault to storage..." mv ~/.vault.zip.gpg ~/Nextcloud/vault.zip.gpg +mv ~/.vault.zip.gpg.sha512 ~/Nextcloud/vault.zip.gpg.sha512 rm -vfr ~/.vault*