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.
33 lines
718 B
Bash
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
|
|
|
|
|