Skip to content

Instantly share code, notes, and snippets.

@rnagle
Created August 20, 2014 16:04
Show Gist options
  • Save rnagle/da6de681cda541e7deac to your computer and use it in GitHub Desktop.
Save rnagle/da6de681cda541e7deac to your computer and use it in GitHub Desktop.
Utility script for stopping, starting and restarting dnsmasq
#!/bin/bash
#
# Install:
#
# Copy this file to a location included in your PATH.
#
# Usage:
#
# $ dnsmasqutil stop|start|restart
#
# Notes:
#
# - You will probably need to use sudo with this utility
# - Assumes you installed dnsmasq via homebrew
#
if [ $1 == 'start' ]
then
launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist;
elif [ $1 == 'stop' ]
then
launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist;
elif [ $1 == 'restart' ]
then
launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist;
launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment