blob: 00cd7a164592c2840dc9cc0861bdaad598bb1a7f (
plain) (
tree)
|
|
# -*- 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")"
'
}
|