Tag Archives: deploy studio

Setting your Munki ClientID as part of a Deploy Studio workflow.

1) Use the hostname form. Important fields are “Computer Name” and “Computer Information #4”
2) Ensure that you have the “Configure” step set up in the workflow and are applying those fields
3) Install Munki Tools and your generic ManagedInstalls.pref
4) Include this script – execute after restart. The script will first check the “Computer Information #4” field, and if empty will reference the “Computer Name” and set ClientIdentifier in the ManagedInstalls.plist file to that value. If neither is filled in, then it silent exits and touches nothing.

Script is below:

#! /bin/bash

### This script checks for a value in the fourth custom field set by ARD/DeployStudio
### and then the computer name (in the Sharing prefpane).
### If a value exists in the custom field, it sets the Client Identifier in 
### ManagedInstalls.plist to that value, other wise it sets the ClientIdentifier to
### the Computer Name.
### -- Tim Schutt, December 13, 2012  taschutt@syr.edu

SYSCLIENTID=$(scutil --get ComputerName)
CUSTCLIENTID=$(defaults read /Library/Preferences/com.apple.RemoteDesktop Text4)

if [ -n "$CUSTCLIENTID" ]
then
	defaults write /Library/Preferences/ManagedInstalls ClientIdentifier $CUSTCLIENTID
elif [ -n "$SYSCLIENTID" ]
then
	defaults write /Library/Preferences/ManagedInstalls ClientIdentifier $SYSCLIENTID
fi

exit 0

Deploy Studio Script – hide Bootcamp partition from OS X.

Place this in your deploy studio workflow, and defer execution until first boot.

#!/bin/bash

## Script by Tim Schutt, 2012 ##

##########################################################
## find the bootcamp partition MUST BE NAMED "BOOTCAMP" ##
##########################################################

BC=$(diskutil list | grep BOOTCAMP | grep -o 'disk[0-9]s[0-9]';) 

##########################################################
## find the UUID of the previous bootcamp partition.    ##
##########################################################

UUID=$(diskutil info $BC | grep -o '[0-9a-zA-Z]\{8\}-[0-9a-zA-Z]\{4\}-[0-9a-zA-Z]\{4\}-[0-9a-zA-Z]\{4\}-[0-9a-zA-Z]\{12\}';)

##########################################################
## Disable auto-mounting of Bootcamp partition. You can ##
## still mount the partition manually with Disk Utility ##
##########################################################

echo "UUID=$UUID none ntfs ro,noauto 0 0" > /etc/fstab

exit 0