From 5cc434463eb2376fa55877b08942fe395fdc4cc0 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 18 Jan 2014 21:49:50 +0100 Subject: Added convenience wrapper to disable blocking services during umount --- .zsh.after/functions.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to '.zsh.after') 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 } -- cgit v1.2.3-54-g00ecf