#!/bin/sh

. /etc/rc.conf

case $1 in
autostart)
	test x"${dns_dhcp:-NO}" = x"NO" && exit 0
	exec $0 start
	;;
start)
	[ -f /etc/dnsmasq.conf ] || exit
	/usr/sbin/dnsmasq
	;;
stop)
	killall dnsmasq
	;;
restart)
	$0 stop
	$0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	;;
esac
exit 0
