### 設置Mac OS X 10.5 Leopard打開NetBoot服務
注:
無論是[Mac OS X: 實用腳本程序(bash scripts)系列-4](http://blog.csdn.net/afatgoat/archive/2009/07/04/4321379.aspx),還是這里的腳本,都是在默認的當前系統的根/下面設置NetBoot的,也就是在/Library/NetBoot目錄里面,通過修改可以變更這個目錄到其它的分區/盤的其它目錄中。
?
簡單介紹NetBoot服務,NetBoot/NetInstall服務用于網絡啟動Mac電腦/安裝Mac系統的服務,它的啟動功能如同無盤工作站,而安裝可以即時網絡更新客戶端的Mac操作系統。
?
<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 Leopard (Client) machine.</span><br style="font-family: Courier New; color: #660000;"/><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 Leopard (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.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 Leopard, 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 "Make sure Internet Sharing is turned OFF Before continuing! (System Preferences > Sharing)</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 DIRECTORIES AND SIMLINKS NEEDED FOR NETBOOTING</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;"/><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;">cd /Library/NetBoot</span><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 (NETWORK FILE SYSTEM)</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;">echo "/Library/NetBoot/NetBootSP0 -ro" >> /etc/exports</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># Note that as soon as the file changes, the OS restarts the NFS daemon</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 DIRECTORIES AND SIMLINKS NEEDED FOR NETBOOTING</span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># --------------------------------Boot</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;"># SET UP BSDP (BOOT SERVICE DISCOVERY PROTOCOL)</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;"># Create the /etc/bootpd.plist file.</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;"># This file below is based on information from the bootpd man page.</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 '<?xml version="1.0" encoding="UTF-8"?></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"><plist version="1.0"></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"><dict></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">??????? <key>bootp_enabled</key></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">??????? <string>en0</string></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">??????? <key>netboot_enabled</key></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">??????? <string>en0</string></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">??????? <key>old_netboot_enabled</key></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;">??????? <string>en0</string></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"></dict></span><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"></plist>' > /etc/bootpd.plist</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;">service bootps start</span><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><br style="font-family: Courier New; color: #660000;"/><span style="font-family: Courier New; color: #660000;"># WE ARE FINISHED</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;">echo"NetBoot setup script complete. Please make sure to add the NetBootSP0and NetBootClients0 folders to your Shared Folders (System Preferences> Sharing > File Sharing)."</span><br style="font-family: Courier New; color: #660000;"/><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: 讓獅子說中文