Skip to content

Commit 1ce933c

Browse files
committed
umountrepo: detect fusermount helper version available on the system
1 parent 583d78a commit 1ce933c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

umountrepo

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,28 @@ if [ "`id -u`" == 0 ]; then
6262
ISROOT=true
6363
else
6464
ISROOT=false
65+
# detect fusermount helper available on the system
66+
FUSERMOUNT=$(command -pv fusermount)
67+
if [ -z "$FUSERMOUNT" ]; then
68+
FUSERMOUNT=$(command -pv fusermount3)
69+
fi
6570
fi
6671

72+
6773
for REPO; do
6874
if $LAZY; then
6975
echo "Lazily unmounting $REPO"
7076
if $ISROOT; then
7177
umount -l $REPO
7278
else
73-
fusermount -uz $REPO
79+
$FUSERMOUNT -uz $REPO
7480
fi
7581
else
7682
echo "Unmounting $REPO"
7783
if $ISROOT; then
7884
umount $REPO
7985
else
80-
fusermount -u $REPO
86+
$FUSERMOUNT -u $REPO
8187
fi
8288
rmdir $REPO
8389
fi

0 commit comments

Comments
 (0)