# I'm not removing the add-doc because I want it to add the Downloads folder, but if you want to remove it on 10.11then uncomment the line below usr/libexec/PlistBuddy -c 'delete:add-app' '$DRIVEPATH/System/Library/CoreServices/Dock.app/Contents/Resources/' #This applies to 10.11+ (not imaging anything older) usr/libexec/plistbuddy -c 'delete:add-app' '$DRIVEPATH/Library/Preferences/'
OSV=$(defaults read '$DRIVEPATH/System/Library/CoreServices/ist' | grep 'ProductVersion' | cut -d ''' -f2| cut -c1-5) OSV=$(defaults read '$DRIVEPATH/System/Library/CoreServices/ist' | grep 'ProductVersion' | cut -d ''' -f2 | cut -c1-4) #Netboot will show one drive named Macintosh HD #Target mode imaging will show two drives named Macintosh HD There is logic to figure out which drive is the target drive, so it works for Netbook and Target Disk Imaging. The trick is to run the script with an After priority in Casper will run after your base image is down but before the reboot (before SIP is enabled). I've been using the following script to modify dockfixup during 10.11 imaging to prevent the extra dock items.