diff options
Diffstat (limited to 'bash/aliases-Zenith')
-rw-r--r-- | bash/aliases-Zenith | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bash/aliases-Zenith b/bash/aliases-Zenith new file mode 100644 index 0000000..ac794c9 --- /dev/null +++ b/bash/aliases-Zenith @@ -0,0 +1,17 @@ +# -*- 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")" +} |