Im trying to do two things that I know I'll be told I shouldn't be doing. First, I'm trying to clean out /Library/Fonts/ of all contents. Second, I'm trying to delete select fonts from /System/Library/Fonts. I dont have the ability to use Universal Type Server, as our environment is unsupported. Our current Font management tool as well as fontbook are insufficient for the issues we are having.
I have been doing this manually for years, including on current OS, with no issues at all, so I'm not worried about stability.We are careful. Please understand that I know it's not recommended. That said...
When I run this script as part of an imaging configuration, script set to run "after", it fails with the below debug output.
Script "Delete all Sierra Fonts"
rm /Library/Fonts/.
rm "/System/Library/Fonts/Apple Braille Outline 6 Dot.ttf"
Log
>Result of running Delete all Sierra Fonts was: rm: /Library/Fonts/.: No such file or directory
>rm: /System/Library/Fonts/Apple Braille Outline 6 Dot.ttf: Operation not permitted
So two issues. The first line is straight forward. I've tried it with quotes, with one wildcard all sorts of ways. It just fails. Running it locally works fine, of course I have to change the command to be rm /Volumes/Macintosh HD 1/Library/Fonts/.
For the second, I know system fonts are protected by SIP, which is why I'm doing this "after" while its still in target disk mode. Again, running the command locally works fine. I CAN sudo rm "/Volumes/Macintosh HD 1/System/Library/Fonts/Apple Braille Outline 6 Dot.ttf" successfully and do this manually, which is how I'm handling it now. However, I don't see why it shouldn't work in a script at image time.
Any ideas?
EDIT: The site is removing the asterisks from the commands. It should read: rm /Library/Fonts/(asterisk).(asterisk)