]>
code.delx.au - monosys/blob - scripts/mount.fuse
75d21bf37bb50b4b9292837869c6c7b3d3ac63f5
4 # Petr Klima <qaxi@seznam.cz>
5 # James Bunton <jamesbunton@fastmail.fm>
6 # Thanks to Miklos Szeredi <miklos@szeredi.hu>
7 # to kick me to the right way
14 USAGE
="${PRGNAME} version ${VERSION}
15 usage: ${PRGNAME} fusefs_type#[mountpath] mountpoint [FUSE options]
17 example: ${PRGNAME} sshfs#root@tux:/ /mnt/tuxssh -o rw
21 echo -e "$PRGNAME# $1" >&2
22 [ -z "$2" ] && exit 128
26 [ "$#" -ge 2 ] || die
"${USAGE}"
28 FSTYPE
=${1%%\#*} # for now i have to be same as FUSE mount binary
29 # should be configurable
32 FSBIN
=`which ${FSTYPE} 2>/dev/null` \
33 || die
"Can not find FUSE mount binary for FS ${FSTYPE}" 1
37 # was there an # in $1
38 [ "$1" = "$MOUNTPATH" ] && MOUNTPATH
=""
41 [ -d "${MOUNTPOINT}" ] || die
"Directory ${MOUNTPOINT} does not exist"
47 ignore_opts
="(user|nouser|users|auto|noauto|_netdev)"
49 OPTIONS
=`echo $@ | sed -r "s/(,${ignore_opts}|${ignore_opts},)//g"`
53 for opt
in ${OPTIONS}; do
54 NEWOPTIONS
="${NEWOPTIONS} -o ${opt}"
58 ${FSTYPE} ${MOUNTPATH} ${MOUNTPOINT} ${NEWOPTIONS}