freebsd-ports/sysutils/fusefs-webdavfs/files/mount_webdavfs.in
Eugene Grosbein 389509f2a2 New port: sysutils/fusefs-webdavfs. It presents FUSE webdav filesystem.
This filesystem behaves like a real network filesystem - no unnecessary
copying of entire files. Currently, it claims read-write support for
Apache's mod_dav and PHP's SabreDav (used by e.g. NextCloud) only.
It forces read-only mode for other DAV servers.
2018-03-10 10:14:17 +00:00

33 lines
718 B
Bash

#!/bin/sh
mountprog=%%PREFIX%%/sbin/mount.webdavfs
while getopts "fo:DF:T:" opt
do
case "$opt" in
o) case "$OPTARG" in
username=*) username=${OPTARG#username=} ;;
password=*) password=${OPTARG#password=} ;;
rw) ;;
*) options="$options,$OPTARG" ;;
esac ;;
T) traceopts="$traceopts,$OPTARG" ;;
*) flags="$flags -$opt $OPTARG" ;;
esac
done
shift $((OPTIND - 1))
[ -n "$username" ] && options="$options,username=$username"
[ -n "$password" ] && options="$options,password=$password"
options=${options#,}
traceopts=${traceopts#,}
[ -n "$traceopts" ] && flags="$flags -T $traceopts"
if [ -z "$options" ]; then
exec $mountprog $flags "$@"
else
exec $mountprog $flags -o "$options" "$@"
fi