TITLE
Mac OS X Server: Adding NetBoot Images To NetInfo
|
Article ID:
Created:
Modified:
|
60131
3/12/99
3/16/99
|
|
TOPIC
DISCUSSION
The following script can be used to add the private_image_volume and shared_image_volume to NetInfo. This is useful if the NetInfo database (/etc/netinfo/local.db) is replaced with the template.
#!/bin/sh
# This script looks for Netboot HD.img and Applications HD.img in
# the following paths /<HFS+ Volume>/<HFS+ Volume>_NBS/SharedImages/
# If it finds them it adds the shared_image_volume and
# private_image_volume properties to netinfo
#
# Written by Scott George with help from Dieter Siegmund
##
# Constants
##
PrivateImage="NetBoot HD.img"
SharedImage="Applications HD.img"
PartialPath="_NBS/SharedImages/"
##
# get the list of mounted HFS volumes
##
mount -t hfs | while read line
do
RealDrive=`echo $line | sed 's/.*on \/\(.*\) (local)/\1/'`
ImagePath="/${RealDrive}/${RealDrive}${PartialPath}"
if [ -e "${ImagePath}${PrivateImage}" ] && \
[ -e "${ImagePath}${SharedImage}" ]; then
niutil -createprop . /config/NetBootServer \
private_image_volume "${RealDrive}"
niutil -createprop . /config/NetBootServer \
shared_image_volume "${RealDrive}"
exit 0
fi
done
echo "No images found"
exit 1
|