我在工作中使用 Mac,希望在启动计算机时安装一些网络共享。我可以使用 bash 脚本(或类似脚本)来连接和挂载这些共享吗?共享来自 Windows 和 Mac 服务器,我们通常使用 IP 地址进行连接。
最佳答案
您可以查看mount_smbfs ,假设您的网络共享是 smbfs/cifs。
mount_smbfs [-N] [-o options] [-d mode] [-f mode] [-h] //[domain;][user[:password]@]server[/share] path
我不太熟悉 OSX 启动过程,但您可以将 shell 脚本创建为/Library/StartupItems 或/System/Library/StartupItems 中的程序/文件夹
如 osxbook.com 中所述
/etc/rc finally launches /sbin/SystemStarter to handle startup items from locations such as /System/Library/StartupItems and /Library/StartupItems. A StartupItem is a program, usually a shell script, whose name matches the folder name. The folder contains a property list file containing key-value pairs such as Description, Provides, Requires, OrderPreference, start/stop messages etc. You can run SystemStarter -n -D as root to have the program print debugging and dependency information (without actually running anything).
关于bash - 在 Mac 上使用 bash 脚本连接到网络共享?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1142286/