Use LUKS for vault
This commit is contained in:
parent
1f668d8563
commit
9b46d175da
2 changed files with 4 additions and 19 deletions
|
@ -1,12 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
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
|
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
|
||||||
|
|
|
@ -1,16 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
echo "Unmounting vault.."
|
|
||||||
sudo umount ~/.vault
|
sudo umount ~/.vault
|
||||||
echo "Encrypting archive..."
|
sudo cryptsetup luksClose vault
|
||||||
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*
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue