Sample Header Ad - 728x90

Launchctl says plist is invalid, plutil says it's OK

7 votes
2 answers
17414 views
I'm trying to have launchd run a shell script when I join a new WiFi network. I've created this plist file (closely based on this SuperUser answer ) at /Users/myname/Library/LaunchAgents/my.networkChangeListener.plist: Label my.networkChangeListener LowPriorityIO ProgramArguments /Users/myname/bin/networkChangeListener/onNetworkChange.sh WatchPaths /etc/resolv.conf /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist RunAtLoad My user is the owner of the plist, and the group is "staff". When I try to load the file by running launchctl load ~/Library/LaunchAgents/my.networkChangeListener.plist, I get an error saying "Invalid property list". However, when I run plutil ~/Library/LaunchAgents/my.networkChangeListener.plist, it returns "OK" What is the problem with my plist file? Is is something specific to launchd? I'm completely at a dead end for how to debug this.
Asked by LiberalArtist (337 rep)
Apr 16, 2015, 01:06 AM
Last activity: Feb 16, 2020, 05:44 PM