CHecksum calculation

This commit is contained in:
Cyryl Płotnicki 2016-10-08 08:04:46 +02:00
parent c6933ab7bd
commit a497edf8b9
2 changed files with 12 additions and 1 deletions

View file

@ -2,7 +2,10 @@
set -e set -e
echo "decrypting..." 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..." echo "mounting..."
mkdir -p ~/.vault mkdir -p ~/.vault
archivemount -o nobackup ~/.vault.zip ~/.vault archivemount -o nobackup ~/.vault.zip ~/.vault

View file

@ -1,8 +1,16 @@
#!/bin/bash #!/bin/bash
set -e set -e
echo "Unmounting vault.."
sudo umount ~/.vault sudo umount ~/.vault
echo "Encrypting archive..."
gpg2 -c ~/.vault.zip 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 ~/Nextcloud/vault.zip.gpg
mv ~/.vault.zip.gpg.sha512 ~/Nextcloud/vault.zip.gpg.sha512
rm -vfr ~/.vault* rm -vfr ~/.vault*