diff options
Diffstat (limited to 'wire-desktop')
| -rwxr-xr-x | wire-desktop/mount-wire | 8 | ||||
| -rwxr-xr-x | wire-desktop/umount-wire | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/wire-desktop/mount-wire b/wire-desktop/mount-wire index a6dde57..60891f7 100755 --- a/wire-desktop/mount-wire +++ b/wire-desktop/mount-wire @@ -1,9 +1,13 @@ #!/bin/dash if mountpoint -q -- "${HOME}/.var/opt/wire/WireCrypt.d"; then - printf '%s\n' 'mount-wire: already mounted' >&2 + printf '%s\n' 'mount-wire: already mounted' >&2 || : elif test -e /dev/mapper/WireCrypt; then - asroot env WIRE_DIR="${HOME}/.var/opt/wire" sh -ec \ + asroot=asroot + if ! isfg; then + asroot=gasroot + fi + $asroot env WIRE_DIR="${HOME}/.var/opt/wire" sh -ec \ 'mount -- /dev/mapper/WireCrypt "${WIRE_DIR}/WireCrypt.d"' else gpg --decrypt -- "${HOME}/.var/opt/wire/WireCrypt.key" | \ diff --git a/wire-desktop/umount-wire b/wire-desktop/umount-wire index 796ea05..ce7f0c0 100755 --- a/wire-desktop/umount-wire +++ b/wire-desktop/umount-wire @@ -1,6 +1,11 @@ #!/bin/dash -asroot env \ +asroot=asroot +if ! isfg; then + asroot=gasroot +fi + +$asroot env \ WIRE_DIR="${HOME}/.var/opt/wire" \ WIRE_DEV="$(losetup | sed 's/\s\+/ /g' | cut -d ' ' -f 1,6 | \ sed -n 's#\(/[^ ]*\) '"$(realpath -- "${HOME}/.var/opt/wire/WireCrypt.img")"'$#\1#p' | sed 1q)" \ |
