Skip to content

Instantly share code, notes, and snippets.

@jacobsalmela
Created August 12, 2014 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jacobsalmela/3191b393144b1524c3fd to your computer and use it in GitHub Desktop.
Save jacobsalmela/3191b393144b1524c3fd to your computer and use it in GitHub Desktop.
(OS X) Disable Bonjour but not DNS
#!/bin/bash
# http://support.apple.com/kb/HT3789
# Jacob Salmela
# 2014-05-31
if [[ $(/usr/libexec/PlistBuddy -c Print /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist | grep 'NoMulticast') ]];then
echo "Boinjour is already disabled."
exit 1
else
launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
/usr/libexec/PlistBuddy -c "Add :ProgramArguments: string -NoMulticastAdvertisements" /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment