有docker建议直接使用docker:docker run -itd --name mydav --device /dev/fuse --cap-add SYS_ADMIN --security-opt "apparmor=unconfined" --env "WEBDRIVE_USERNAME=用户名" --env "WEBDRIVE_PASSWORD=密码" --env "WEBDRIVE_URL=http://172.17.0.5:48080/remote.php/dav/files/eric/" --env "DAVFS2_ASK_AUTH=0" -v /mnt/dav:/mnt/webdrive:rshared efrecon/webdav-client 安装所需软件包:apt-get install davfs2 -y 创建挂载目录:mkdir /mnt/dav 挂载:mount -t davfs -o noexec https://nextcloud./remote.php/webdav/ /mnt/dav/ 卸载:umount /mnt/dav 保存账号密码:cat << EOF | sudo tee -a /etc/davfs2/secrets # personal webdav, nextcloud application password /mnt/dav milosz mypassword # older versions used URL, it is equivalent for compatibility reasons #https://nextcloud./remote.php/webdav/ milosz mypassword EOF 开机自动挂载:cat << EOF | sudo tee -a /etc/fstab # personal webdav https://nextcloud./remote.php/webdav/ /mnt/dav davfs _netdev,noauto,user,uid=milosz,gid=milosz 0 0 EOF |
|