aboutsummaryrefslogtreecommitdiffstats
path: root/element-desktop/bash-aliases
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-04-26 22:50:50 +0200
committerMattias Andrée <maandree@kth.se>2022-04-26 22:50:50 +0200
commit16f7d08bcaf01c40ccaad688a8709bfced68b10e (patch)
treed8e30f7cca448e8057d0110c74582217c22ee0ab /element-desktop/bash-aliases
parentemacs: restore comment colour to red (diff)
downloaddotfiles-16f7d08bcaf01c40ccaad688a8709bfced68b10e.tar.gz
dotfiles-16f7d08bcaf01c40ccaad688a8709bfced68b10e.tar.bz2
dotfiles-16f7d08bcaf01c40ccaad688a8709bfced68b10e.tar.xz
Use losetup -d instead of --detach and add clean up
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--element-desktop/bash-aliases3
1 files changed, 2 insertions, 1 deletions
diff --git a/element-desktop/bash-aliases b/element-desktop/bash-aliases
index 5689df2..fa8afea 100644
--- a/element-desktop/bash-aliases
+++ b/element-desktop/bash-aliases
@@ -14,6 +14,7 @@ umount-element () {
asroot env XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}" ELEMENT_DIR=~/.var/opt/element sh -c '
umount "${ELEMENT_DIR}/ElementCrypt.d"
cryptsetup close ElementCrypt
- losetup --detach "$(cat -- "${XDG_RUNTIME_DIR}/ElementCrypt")"
+ losetup -d "$(cat -- "${XDG_RUNTIME_DIR}/ElementCrypt")"
+ rm -f -- "${XDG_RUNTIME_DIR}/ElementCrypt"
'
}