Dec 14, '03 02:08:00AM • Contributed by: ssevenup
As such, I created a shell script that parses the two most common places where preference plist files are found, and returns the errors if any are found. Armed with this information, one can decide to trash the files or inspect them. I will be placing this shell script in /usr/local/bin on my client systems, so I can ssh into them and run the script when problems are being reported. Later, I may automate a nightly job that notifies either me or the user.
Code has been revised since hint first published...
#!/bin/sh
# plist_chk.sh
# Check that we are being run as root
if [ $USER != "root" ]; then
echo "You must be root to execute this script."
echo ""
exit 1
fi
find /Library/Preferences -name "*.plist" -print0 | \
xargs -0 /usr/bin/plutil -lint -s
find /Users -name "*.plist" -print0 | \
xargs -0 /usr/bin/plutil -lint -s
[robg adds: Create the script, save it, make it executable, and run it -- it didn't flag anything on my machine, but ... next time I have what I suspect to be a bad preferences problem, I'll try this little routine first to see if it also sees a problem. Just yet another arrow in the troubleshooter's quiver...]
