aboutsummaryrefslogtreecommitdiffstats
path: root/.zsh.after/functions.zsh
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-01-18 21:49:50 +0100
committerDavid Runge <david.runge@frqrec.com>2014-01-18 21:49:50 +0100
commit5cc434463eb2376fa55877b08942fe395fdc4cc0 (patch)
tree780ad8354863d86ce9c304461c7a2e53be43daf8 /.zsh.after/functions.zsh
parent102b19114e948703fd82e1f6915d379c8e4c50a1 (diff)
downloaddotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.tar.gz
dotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.tar.bz2
dotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.tar.xz
dotfiles-5cc434463eb2376fa55877b08942fe395fdc4cc0.zip
Added convenience wrapper to disable blocking services during umount
Diffstat (limited to '.zsh.after/functions.zsh')
-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
}