Skip to content

Mac开启自动加载群晖NAS上的smb文件服务器

Tags:

先实验一下手动连接

然后terminal中用命令行试试

cd ~/qh && mkdir mov517 bak517 sss517 staging
mount -t smbfs //username:[email protected]/mov517 ~/qh/mov517

成功之后,建立脚本

username="your_username"
password="your_password"
ip="your_ip"

cat > ~/qh/qh_smb_automount <<EOF
cd ~/qh && mkdir mov517 bak517 sss517 staging
mount -t smbfs //${username}:${password}@${ip}/mov517 ~/qh/mov517 &
mount -t smbfs //${username}:${password}@${ip}/sss517 ~/qh/sss517 &
mount -t smbfs //${username}:${password}@${ip}/bak517 ~/qh/bak517 &
mount -t smbfs //${username}:${password}@${ip}/staging ~/qh/staging
EOF
sudo chmod +x ~/qh/qh_smb_automount

加入开启自启动项

卸载

umount ~/qh/mov517

Leave a Reply

Your email address will not be published.