Mac OS X: 实用脚本程序(bash scripts)系列-4
来源:互联网 发布:原宿风打扮 知乎 编辑:程序博客网 时间:2024/04/29 17:03
设置Mac OS X 10.4 Tiger打开NetBoot服务的脚本
#!/bin/bash
#This script sets up netbooting on a Tiger (Client) machine.
# START WITH SOME SANITY CHECKS
# -----------------------------
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "You must run this script as the root user. (Try /"sudo $0/")"
exit 1
fi;
# check that this is Mac OS X Tiger (Client)
if[[ "`sw_vers -productName`" != "Mac OS X" ]] || [[ "`sw_vers-productVersion`" < "10.4" ]] || [[ "`sw_vers -productVersion`" >"10.5" ]] ; then
echo "The script is designed to be run on Mac OS X Tiger, on a non-server version."
exit 2
fi;
echo "This will now setup NetBooting on your machine.
Press Enter to continue."
read junk
# CREATE FOLDERS AND SYMLINKS
# ---------------------------
mkdir -p /Library/NetBoot/NetBootSP0
mkdir /Library/NetBoot/NetBootClients0
chown root:admin /Library/NetBoot/NetBoot*
chmod 775 /Library/NetBoot/NetBoot*
ln -s NetBootSP0 /Library/NetBoot/.sharepoint
ln -s NetBootClients0 /Library/NetBoot/.clients
# EXPORT NETBOOTING FOLDERS OVER NFS
# ----------------------------------
nicl . -create /exports
nicl . -create '/exports///Library//NetBoot//NetBootSP0' opts ro
service com.apple.portmap start
mountd
nfsd -t -u
# SETUP AFP SHAREPOINTS AND BSDP
# ------------------------------
nicl . -create /config/SharePoints/NetBootSP0
nicl . -create /config/SharePoints/NetBootSP0 afp_name NetBootSP0
nicl . -create /config/SharePoints/NetBootSP0 afp_shared 1
nicl . -create /config/SharePoints/NetBootSP0 afp_guest 0
nicl . -create /config/SharePoints/NetBootSP0 directory_path /Library/NetBoot/NetBootSP0
nicl . -create /config/SharePoints/NetBootClients0
nicl . -create /config/SharePoints/NetBootClients0 afp_name NetBootClients0
nicl . -create /config/SharePoints/NetBootClients0 afp_shared 1
nicl . -create /config/SharePoints/NetBootClients0 afp_guest 0
nicl . -create /config/SharePoints/NetBootClients0 directory_path /Library/NetBoot/NetBootClients0
nicl . -create /config/NetBootServer
nicl . -create /config/dhcp netboot_enabled en0
service bootps start
# SETUP TFTP SYMLINK
# ------------------
ln -s /Library/NetBoot /private/tftpboot/NetBoot
service tftp start
echo "NetBoot setup script complete."
#This script sets up netbooting on a Tiger (Client) machine.
# START WITH SOME SANITY CHECKS
# -----------------------------
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "You must run this script as the root user. (Try /"sudo $0/")"
exit 1
fi;
# check that this is Mac OS X Tiger (Client)
if[[ "`sw_vers -productName`" != "Mac OS X" ]] || [[ "`sw_vers-productVersion`" < "10.4" ]] || [[ "`sw_vers -productVersion`" >"10.5" ]] ; then
echo "The script is designed to be run on Mac OS X Tiger, on a non-server version."
exit 2
fi;
echo "This will now setup NetBooting on your machine.
Press Enter to continue."
read junk
# CREATE FOLDERS AND SYMLINKS
# ---------------------------
mkdir -p /Library/NetBoot/NetBootSP0
mkdir /Library/NetBoot/NetBootClients0
chown root:admin /Library/NetBoot/NetBoot*
chmod 775 /Library/NetBoot/NetBoot*
ln -s NetBootSP0 /Library/NetBoot/.sharepoint
ln -s NetBootClients0 /Library/NetBoot/.clients
# EXPORT NETBOOTING FOLDERS OVER NFS
# ----------------------------------
nicl . -create /exports
nicl . -create '/exports///Library//NetBoot//NetBootSP0' opts ro
service com.apple.portmap start
mountd
nfsd -t -u
# SETUP AFP SHAREPOINTS AND BSDP
# ------------------------------
nicl . -create /config/SharePoints/NetBootSP0
nicl . -create /config/SharePoints/NetBootSP0 afp_name NetBootSP0
nicl . -create /config/SharePoints/NetBootSP0 afp_shared 1
nicl . -create /config/SharePoints/NetBootSP0 afp_guest 0
nicl . -create /config/SharePoints/NetBootSP0 directory_path /Library/NetBoot/NetBootSP0
nicl . -create /config/SharePoints/NetBootClients0
nicl . -create /config/SharePoints/NetBootClients0 afp_name NetBootClients0
nicl . -create /config/SharePoints/NetBootClients0 afp_shared 1
nicl . -create /config/SharePoints/NetBootClients0 afp_guest 0
nicl . -create /config/SharePoints/NetBootClients0 directory_path /Library/NetBoot/NetBootClients0
nicl . -create /config/NetBootServer
nicl . -create /config/dhcp netboot_enabled en0
service bootps start
# SETUP TFTP SYMLINK
# ------------------
ln -s /Library/NetBoot /private/tftpboot/NetBoot
service tftp start
echo "NetBoot setup script complete."
- Mac OS X: 实用脚本程序(bash scripts)系列-4
- Mac OS X: 实用脚本程序(bash scripts)系列
- Mac OS X: 实用脚本程序(bash scripts)系列-2
- Mac OS X: 实用脚本程序(bash scripts)系列-3
- Mac OS X: 实用脚本程序(bash scripts)系列-5
- Mac OS X: 实用脚本程序(bash scripts)系列-6
- Mac OS X: 实用脚本程序(bash scripts)系列-6
- Mac OS X: 实用脚本程序(bash scripts)系列-7
- Mac OS X: 实用脚本程序(bash scripts)系列-8
- Mac OS X: 实用脚本程序(bash scripts)系列-9
- Mac OS X: 实用脚本程序(bash scripts)系列-10
- Mac OS X: 实用脚本程序(bash scripts)系列-11
- Mac OS X: 实用脚本程序(bash scripts)系列-12
- Mac OS X: 实用脚本程序(bash scripts)系列-13
- OS X: 实用脚本程序(bash scripts)系列-13
- OS X: 实用脚本程序(bash scripts)系列-14
- OSX: 实用脚本程序(bash scripts)系列-19
- OSX: 实用脚本程序(bash scripts)系列-20
- Win2003 IIS6 asp aspnet安全详细配置
- APWeb 2010 Calls for Papers
- 彻底弄懂CSS+DIV
- 精通CSS滤镜(FILTER)
- 儒豹公布2009年6月手机搜索热门关键词排行榜
- Mac OS X: 实用脚本程序(bash scripts)系列-4
- nginx 内置变量大全
- Mac OS X: 实用脚本程序(bash scripts)系列-5
- mdAxelerator - 用快捷键创建新文件夹
- C++ Primer 学习笔记:string类
- prototype源代码解读(转自javaeye)
- 从此
- DirectX粒子--雪花
- mdAxel仅用快捷键就能创建新文件夹