blob: ac794c9e2f3a38dc8c2b4ab5f9e0cf79a7b47bba (
plain) (
tree)
|
|
# -*- shell-script -*-
mount-crypt () {
sudo printf '' && \
device="$(sudo losetup --show -f -P /media/Secondary/.crypt/crypt.img)" && \
printf '%s\n' "${device}" > "${XDG_RUNTIME_DIR}/CryptCrypt" && \
gpg --decrypt /media/Secondary/.crypt/crypt.key | sudo cryptsetup -d - open "${device}" CryptCrypt && \
mkdir -p ~/Crypt && \
sudo mount /dev/mapper/CryptCrypt ~/Crypt
}
umount-crypt () {
sudo umount ~/Crypt
rmdir ~/Crypt
sudo cryptsetup close CryptCrypt
sudo losetup --detach "$(cat -- "${XDG_RUNTIME_DIR}/CryptCrypt")"
}
|