Quick question. I have a script that removes the Gotham font family from users computer. I know that it could be a little dangerous using the wildcard but it seems to work ok. Here is the problem that I am running up against. The script works great when called from check in, running under the sudo user. I am trying to make this deployed safely so we are first having a policy that asked the user for restart. Upon restart or logging in I am calling the script. When called from the JSS I can’t seem to get it to run under the right user (with login hooks which I really can’t get working or with a startup script). I tried outset and I think that works for the system lvl font removal but not the user. Any help would be greatly appreciated.
#!bin/sh
#This script is designed to remove all Gotham fonts from the /Library/Font + in the user library font folder as well.
COUNT=$(rm -v /Library/Fonts/Gotham* 2> /dev/null | wc -l)
COUNT1=$(rm -v /Users/*/Library/Fonts/Gotham* 2> /dev/null | wc -l)
#searches the two locations on the computer where the Gotham font would live. This is an assumption but should cover the bases pretty throughly.
COUNTTOT=$((COUNT + COUNT1))
#adds the two file locations and sets them as a variable for use later in the echo statement.
echo "Removed $COUNTTOT Gotham Fonts"
#reads out the total number of fonts removed.