【发布时间】:2020-04-28 17:20:25
【问题描述】:
我正在尝试创建一个脚本来在 Linux 中挂载一系列 webDAV 文件夹。
现在这在执行时是可能的:
sudo mount -t davfs -o noexec http://dav.website.com /mnt/
问题是,一旦执行命令,就会要求用户输入凭据...
enter username:
enter password:
现在我对整个系列的在线 DAV 文件夹都有相同的密码和用户名
有没有办法让我编写一个 bash 或 bash 嵌入式 python 脚本?
我已经尝试了以下
sudo mount -t davfs -o noexec http://dav.website.com /mnt/ |echo username\npassowrd
,但没有成功。
我真的要使用
sudo mount -t davfs -o noexec http://dav.website.com /mnt/
方法。
【问题讨论】:
-
看看expect,它是为这类事情而生的。