--- /sbin/mount.fuse 2007-04-28 17:22:12.000000000 +0200 +++ /tmp/mount.fuse 2007-04-28 10:38:03.000000000 +0200 @@ -6,7 +6,7 @@ # to kick me to the right way # -VERSION="0.0.1" +VERSION="0.0.2" PRGNAME=`basename $0` if [ -z "$HOME" ]; then @@ -20,8 +20,8 @@ example: ${PRGNAME} sshfs#root@tux:/ /mnt/tuxssh -o rw " -function die { - echo -e "$PRGNAME# $1" >&2 +die { + echo "$PRGNAME# $1" >&2 [ -z "$2" ] && exit 128 exit "$2" } @@ -45,8 +45,20 @@ shift shift -ignore_opts='\(user\|nouser\|users\|auto\|noauto\|_netdev\)' - -OPTIONS=`echo $@ | sed "s/,${ignore_opts}\|${ignore_opts},//g"` - -${FSTYPE} ${MOUNTPATH} ${MOUNTPOINT} ${OPTIONS} +# loop over each mount option and skip all that should be ignored +IFS="," +for OPT in $@; do + OPT=`echo $OPT | sed "s/^\(-o\|user\|nouser\|users\|auto\|noauto\|_netdev\)$/IGNORE/"` + if [ "$OPT" == "IGNORE" ]; then continue; fi + OPTIONS="$OPTIONS$OPT," +done +IFS=" " + +# add "-o " and remove trailing comma +OPTIONS="-o `echo $OPTIONS | sed "s/,$//"`" + +if test -z "$MOUNTPATH"; then + "${FSTYPE}" "${MOUNTPOINT}" ${OPTIONS} +else + "${FSTYPE}" "${MOUNTPATH}" "${MOUNTPOINT}" ${OPTIONS} +fi