aboutsummaryrefslogtreecommitdiffstats
path: root/wire-desktop/bash-aliases
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wire-desktop/bash-aliases18
1 files changed, 18 insertions, 0 deletions
diff --git a/wire-desktop/bash-aliases b/wire-desktop/bash-aliases
new file mode 100644
index 0000000..00cd7a1
--- /dev/null
+++ b/wire-desktop/bash-aliases
@@ -0,0 +1,18 @@
+# -*- shell-script -*-
+
+mount-wire () {
+ asroot env XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}" WIRE_DIR=~/.var/wire sh -ec '
+ device="$(losetup --show -f -P "${WIRE_DIR}/WireCrypt.img")"
+ printf "%s\n" "${device}" > "${XDG_RUNTIME_DIR}/WireCrypt"
+ gpg --decrypt "${WIRE_DIR}/WireCrypt.key" | cryptsetup -d - open "${device}" WireCrypt
+ mount /dev/mapper/WireCrypt "${WIRE_DIR}/WireCrypt.d"
+ '
+}
+
+umount-wire () {
+ asroot env XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}" WIRE_DIR=~/.var/wire sh -c '
+ umount "${WIRE_DIR}/WireCrypt.d"
+ cryptsetup close WireCrypt
+ losetup --detach "$(cat -- "${XDG_RUNTIME_DIR}/WireCrypt")"
+ '
+}