From 820b43a749935bf1352c7e427d22052d74f65cf6 Mon Sep 17 00:00:00 2001 From: q Date: Wed, 4 Dec 2024 13:34:45 +0200 Subject: [PATCH] only unmount my processes --- web/sshfs-mount | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/sshfs-mount b/web/sshfs-mount index 45c72df..bc144a9 100755 --- a/web/sshfs-mount +++ b/web/sshfs-mount @@ -17,7 +17,7 @@ _helpexit() { _current_mounts() { echo Current mounts: - cat /proc/mounts | grep fuse.sshfs | awk '{ print $1 " " $2 }' | sed "s,$HOME,~," | xargs printf "%15s %s\n" + cat /proc/mounts | grep fuse.sshfs | grep user_id=$( id -u ) | awk '{ print $1 " " $2 }' | sed "s,$HOME,~," | xargs printf "%15s %s\n" } _hosts() { @@ -80,7 +80,7 @@ if [[ "$unmount" = true ]]; then rmdir --ignore-fail-on-non-empty ~/mnt/$valid_name &>/dev/null else # no path, unmount all - cat /proc/mounts | grep fuse.sshfs | awk '{ print $2 }' | while read dir; do + cat /proc/mounts | grep fuse.sshfs | grep user_id=$( id -u ) | awk '{ print $2 }' | while read dir; do echo Unmounting $dir fusermount -u -z "$dir" rmdir --ignore-fail-on-non-empty "$dir" &>/dev/null