I have a package that i want to install at imaging time that will nuke all the fonts on the image and only add back these fonts in the package. I have taken the time to find out what are the base OS fonts needed and want to remove the rest.
I have it in a PKG form so i can do a preinstall script in the package. Here is the script:
#!/bin/sh
## preinstall
pathToScript=$0
pathToPackage=$1
targetLocation=$2
targetVolume=$3
###### removes fonts in system and library level
/bin/rm -rf "/Library/Fonts/" /bin/rm -rf "/System/Library/Fonts/"
exit 0 ## Success
exit 1 ## Failure
For some reason it dose not delete the fonts. it just adds that fonts from the package. (I also gave the fonts a label so i would know what fonts where added to a computer down the road)
I have given it a priority of 20 so it is the last package to install in case any others also installed fonts.
Richard