### 设置Mac OS X 10.4 Tiger打开NetBoot服务的脚本
<table id="ep:e" style="width: 100%;" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000"><tbody><tr><td width="100%"><span style="font-family: Courier New; color: #660000;">#!/bin/bash</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">#This script sets up netbooting on a Tiger (Client) machine.</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># START WITH SOME SANITY CHECKS</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># -----------------------------</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># Make sure only root can run our script</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">if [ "$(id -u)" != "0" ]; then</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"> echo "You must run this script as the root user. (Try /"sudo $0/")"</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"> exit 1</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">fi;</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># check that this is Mac OS X Tiger (Client)</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">if[[ "`sw_vers -productName`" != "Mac OS X" ]] || [[ "`sw_vers-productVersion`" < "10.4" ]] || [[ "`sw_vers -productVersion`" >"10.5" ]] ; then</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"> echo "The script is designed to be run on Mac OS X Tiger, on a non-server version."</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"> exit 2</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">fi;</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">echo "This will now setup NetBooting on your machine. </span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">Press Enter to continue."</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">read junk</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># CREATE FOLDERS AND SYMLINKS</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># ---------------------------</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">mkdir -p /Library/NetBoot/NetBootSP0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">mkdir /Library/NetBoot/NetBootClients0</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">chown root:admin /Library/NetBoot/NetBoot*</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">chmod 775 /Library/NetBoot/NetBoot*</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">ln -s NetBootSP0 /Library/NetBoot/.sharepoint</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">ln -s NetBootClients0 /Library/NetBoot/.clients</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># EXPORT NETBOOTING FOLDERS OVER NFS </span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># ----------------------------------</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /exports</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create '/exports///Library//NetBoot//NetBootSP0' opts ro</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">service com.apple.portmap start</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">mountd</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nfsd -t -u</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># SETUP AFP SHAREPOINTS AND BSDP </span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># ------------------------------</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootSP0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootSP0 afp_name NetBootSP0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootSP0 afp_shared 1</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootSP0 afp_guest 0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootSP0 directory_path /Library/NetBoot/NetBootSP0</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootClients0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootClients0 afp_name NetBootClients0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootClients0 afp_shared 1</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootClients0 afp_guest 0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/SharePoints/NetBootClients0 directory_path /Library/NetBoot/NetBootClients0</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/NetBootServer</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">nicl . -create /config/dhcp netboot_enabled en0</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">service bootps start</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># SETUP TFTP SYMLINK</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># ------------------</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">ln -s /Library/NetBoot /private/tftpboot/NetBoot</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">service tftp start</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">echo "NetBoot setup script complete."</span><br/></td></tr></tbody></table>
- 前言
- Mac OS X:如何将个人文件夹从默认卷移到其他卷(适合OSX10.5 Leopard)
- Mac OS X:Finder菜单中的Connect to Server选项禁止和打开
- Mac OS X: 苹果机支持的分区表类型及问题解决
- Mac OS X: 偏好Preferences基础(1)
- Mac OS X: 如何变更Office for Mac的注册码
- Mac OS X: 禁止/防止网络用户复制app程序到桌面
- Mac OS X: 用户帐户的选择
- Mac OS X: 实用脚本程序(bash scripts)系列
- Mac OS X: 共享iPhoto图片
- Mac OS X: 实用脚本程序(bash scripts)系列-2
- Mac OS X: 实用脚本程序(bash scripts)系列-3
- Mac OS X: 实用脚本程序(bash scripts)系列-4
- Mac OS X: 实用脚本程序(bash scripts)系列-5
- Mac OS X: 实用脚本程序(bash scripts)系列-6
- Mac OS X:升级rsync和同步应用实例
- Mac OS X: XAMP在Mac上的实现
- Mac OS X瘦身多法
- Mac OS X 10.5快速系统部署实践-计划(2) v1
- Mac OS X 10.5快速系统部署实践-制作核心系统镜像(1) v1
- Mac OS X数据备份方案一例
- Mac OS X数据备份方案一例(2)
- Mac OS X 10.5快速系统部署实践-制作核心系统镜像(2) v1
- Mac OS X: 打印系统治疗
- Mac OS X:禁止崩溃报告
- Mac OS X:Snow Leopard的几个改动(管理员相关)
- Mac OS X排错:雪豹的最新更新Airport可能不支持无线802.11n网络
- Mac OS X:雪豹内置支持读写NTFS卷
- Mac OS X:定制生成新用户的程序包
- Mac OS X:在Windows里面使用命令行设置启动系统
- Mac OS X: 实用脚本程序(bash scripts)系列-7
- Mac OS X:一种从APP中获得PKG的方法
- Mac OS X: bash脚本实现添加无线SSID(Update2009-10-09)
- Mac OS X: 实用脚本程序(bash scripts)系列-8
- Mac OS X 10.5快速系统部署实践-制作核心系统镜像(4) v1
- Mac OS X: 彻底删除GeekTool(bash脚本)
- Mac OS X: 实用脚本程序(bash scripts)系列-9
- 把你的Leopard变成Mac OS X的系统发布服务器(1)
- 把你的Leopard变成Mac OS X的系统发布服务器(2)
- 把你的Leopard变成Mac OS X的系统发布服务器(3)
- Mac OS X: 访问控制远程CUPS服务
- Mac &amp; Win混合平台访问和工具
- Mac OS X: DeployStudio更新v1.0rc16
- Mac: 想当Apple菜鸟不容易(1)
- Mac: 想当 Apple菜鸟不容易(2)
- Mac: 想当 Apple菜鸟不容易(3)
- Mac: 想当 Apple菜鸟不容易(4完)
- Mac电脑上处理摄像机上的存储内容
- Mac OS X: Google自动更新程序的卸载
- 雪豹系统和SMB不兼容的问题的解决汇总
- Mac OS X: 实用脚本程序(bash scripts)系列-10
- Mac OS X:MagicPrefs介绍
- Mac OS X: 系统部署后程序安装的用户提示
- Mac OS X:开启单程序模式
- Mac OS X: 在脚本里关闭Airport
- Mac笔记本电池:十点建议和其它
- Mac OS X: Launchd执行程序的一个例子
- Mac OS X:修改SMART Utility期限限制
- Mac OS X:网络用户环境个性配置实例
- Mac OS X:强制退出CD/DVD盘
- Mac OS X: launchd plist在线编辑器
- Mac OS X: 实用脚本程序(bash scripts)系列-11
- Mac OS X: 实用脚本程序(bash scripts)系列-12
- Mac: 卸载Safari 5.0.2
- Mac OS X: 实用脚本程序(bash scripts)系列-13
- Mac OS X: 文件图标制作和变更(Resource Fork)
- Mac OS X 10.6.6更新之后NTFS只读的解决
- Mac: 网络用户遇到Adobe Reader 9.x/10.x异常退出的解决
- Mac OS X: airport命令的参数
- Mac OS X的Spotlight综述
- Mac OS X:AFP和SMB共享配置详细配置
- Mac OS X:详细解读Munki和应用
- Mac OS X:显示/设置分辨率的命令(源程序)
- Mac OS X: 是否升级到Lion?
- OSX: 禁止Flash Player 10.3自动更新
- OSX脚本:禁止系统自动添加AppStore图标到用户Dock上
- 狮子GM版本的安装
- OS X Lion狮子安装盘的初步研究
- OS X Lion狮子的恢复盘的删除二法
- OSX: Finder的侧边栏(Sidebar)不显示已装载的网络共享
- OSX:隐藏文件或文件夹
- OS X: 实用脚本程序(bash scripts)系列-13
- OS X: 实用脚本程序(bash scripts)系列-14
- OSX:Lion支持登录窗口的Policy Banner
- OSX: 让狮子说中文