mirror of
https://github.com/vgough/encfs.git
synced 2025-02-01 18:39:16 +01:00
Use umount
on systems where fusermount
is not available.
This commit is contained in:
parent
340fefda32
commit
95d6ae8bec
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# This script mounts an encfs filesystem, starts a shell in the mounted
|
# This script mounts an encfs filesystem, starts a shell in the mounted
|
||||||
# directory, and then unmounts the filesystem when the shell exits.
|
# directory, and then unmounts the filesystem when the shell exits.
|
||||||
# This is an equivalent of the cfssh utility for cfs.
|
# This is an equivalent of the cfssh utility for cfs.
|
||||||
# Contributed by David Rosenstrauch.
|
# Contributed by David Rosenstrauch.
|
||||||
|
|
||||||
canonicalize() {
|
canonicalize() {
|
||||||
@ -60,6 +60,10 @@ echo "Directory is $unenc_dir"
|
|||||||
orig_dir=$(pwd)
|
orig_dir=$(pwd)
|
||||||
cd $unenc_dir
|
cd $unenc_dir
|
||||||
|
|
||||||
# Set the shell up
|
# Fall back to umount if fusermount is not available (e.g., on OS X)
|
||||||
exec /bin/sh -c "$SHELL ; cd $orig_dir ; fusermount -u $unenc_dir ; if ! $unenc_dir_given; then rmdir $unenc_dir; fi"
|
FUSE_UMOUNT="$(which 2>/dev/null fusermount)"
|
||||||
|
FUSE_UMOUNT="${FUSE_UMOUNT:+fusermount -u}"
|
||||||
|
FUSE_UMOUNT="${FUSE_UMOUNT:-umount}"
|
||||||
|
|
||||||
|
# Set the shell up
|
||||||
|
exec /bin/sh -c "$SHELL ; cd $orig_dir ; $FUSE_UMOUNT $unenc_dir ; if ! $unenc_dir_given; then rmdir $unenc_dir; fi"
|
||||||
|
Loading…
Reference in New Issue
Block a user