From 5a7db2f34aa6a6787d98a001b6d28be97f36abf4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 25 Jun 2021 12:56:30 +0200 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- bash/aliases-Zenith | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bash/aliases-Zenith (limited to 'bash/aliases-Zenith') 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")" +} -- cgit v1.2.3-70-g09d2