Use LUKS for vault

This commit is contained in:
Cyryl Płotnicki 2016-10-16 12:52:05 +02:00
parent 1f668d8563
commit 9b46d175da
2 changed files with 4 additions and 19 deletions

View file

@ -1,12 +1,7 @@
#!/bin/bash
set -e
echo "decrypting..."
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
sudo cryptsetup luksOpen ~/Nextcloud/vault.img vault
sudo mount /dev/mapper/vault ~/.vault
sudo chown $USER ~/.vault

View file

@ -1,16 +1,6 @@
#!/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*
sudo cryptsetup luksClose vault