diff options
author | David Runge <david.runge@frqrec.com> | 2014-01-18 21:49:50 +0100 |
---|---|---|
committer | David Runge <david.runge@frqrec.com> | 2014-01-18 21:49:50 +0100 |
commit | 5cc434463eb2376fa55877b08942fe395fdc4cc0 (patch) | |
tree | 780ad8354863d86ce9c304461c7a2e53be43daf8 | |
parent | 102b19114e948703fd82e1f6915d379c8e4c50a1 (diff) | |
download | dotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.tar.gz dotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.tar.bz2 dotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.tar.xz dotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.zip |
Added convenience wrapper to disable blocking services during umount
-rw-r--r-- | .zsh.after/functions.zsh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/.zsh.after/functions.zsh b/.zsh.after/functions.zsh index 284b837..5dc5943 100644 --- a/.zsh.after/functions.zsh +++ b/.zsh.after/functions.zsh @@ -268,10 +268,18 @@ function lopen () { function lclose () { notmounted=$(mountpoint /mnt/$1) if [ "$?" -eq 0 ]; then + #stop services blocking the umount + if [[ $HOST == "homey" ]]; then + sudo systemctl stop rpc-{idmapd,mountd} rpcbind + fi sudo umount /mnt/$1 sudo cryptsetup luksClose $1 + #restart services that blocked the umount + if [[ $HOST == "homey" ]]; then + sudo systemctl start rpc-{idmapd,mountd} rpcbind + fi else - echo "/mnt/$1 is not a mountpoint" + echo "/mnt/$1 is not a mountpoint or not mounted." fi } |