aboutsummaryrefslogtreecommitdiffstats
path: root/.zsh.after
diff options
context:
space:
mode:
Diffstat (limited to '.zsh.after')
-rw-r--r--.zsh.after/functions.zsh10
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
}