New administrator (K2000): Mac imaging (pre/post installation tasks help request)
I've gone through the information available here:
http://www.itninja.com/blog/view/capture-deploy-a-mac-image-from-start-to-finish-in-k2000-version-3-4
Great start, got the image built. Now having difficulties with understanding the pre/post installation tasks. I come from a PC administrative setting with a user perspective for Macs, so still trying to understand the Mac side scripting. I've had some success with a manually run script after installing the OS image, but would like to automate the process in order to streamline it for the techs with less familiarity with Macs. The default script references a file that associates computer names with their mac addresses, but I am uncertain as to the location of this file referenced:
#!/bin/bash MAC=`/usr/sbin/networksetup -getmacaddress Ethernet 2> /dev/null | awk ' { print $3; }' | sed -e s/://g ` TEMP_PATH="/opt/kace/petemp/${MAC}" IFS=$'\n' volume=`mount | grep -m 1 disk0` zeroMount=`echo "$volume" | awk '{ print substr($0,index($0, "on ")+3,index($0, "(")-index($0, "on ")-4) }'` prefPath=${KACE_SYSTEM_DRIVE_PATH}/Library/Preferences/SystemConfiguration/preferences.plist tComputerName=`/usr/libexec/PlistBuddy -c "Print System:System:ComputerName" $prefPath` computerName=`echo $tComputerName | awk '{ print index($0,"Not Exist") }'` if [ x$computerName == x0 ]; then computerName=$tComputerName else computerName="localhost" fi echo $computerName > "${TEMP_PATH}" exit 0
3 Comments
[ + ] Show comments
Answers (0)
Please log in to answer
Be the first to answer this question
#!/bin/bash
# Set variables
echo Enter new computer name:
read NEWCOMPUTERNAME
echo Enter new domain name:
read NEWDOMAINNAME
NEWHOSTNAME=$NEWCOMPUTERNAME.$NEWDOMAINNAME
# Change hostname
echo Configuring hostname...
hostname $NEWHOSTNAME
scutil --set HostName $NEWHOSTNAME
echo Done configuring hostname
echo Configuring local hostname
scutil --set LocalHostName $NEWHOSTNAME
echo Done configuring local hostname
# Change computername (Bonjour and AppleTalk name)
echo Configuring computername...
#systemsetup -setcomputername $NEWCOMPUTERNAME
scutil --set ComputerName $NEWHOSTNAME
echo Done configuring computername - wtaira 9 years ago
Is there a way to run a script that opens the console window and waits for user input? I would prefer to avoid leaving an AD admin account and password in a text file just to add the imaged computers to the domain. - wtaira 9 years ago