Skip to content
Snippets Groups Projects
dnsmasq.init 26.3 KiB
Newer Older
boot()
{
	BOOT=1
	start "$@"
}

start_service() {
	local instance="$1"
	local instance_found=0

	[ -n "$BOOT" ] && return

	. /lib/functions/network.sh

	config_cb() {
		local type="$1"
		local name="$2"
		if [ "$type" = "dnsmasq" ]; then
			if [ -n "$instance" -a "$instance" = "$name" ]; then
				instance_found=1
			fi
		fi
	}

	config_load dhcp

	if [ -n "$instance" ]; then
		[ "$instance_found" -gt 0 ] || return
		dnsmasq_start "$instance"
	else
		config_foreach dnsmasq_start dnsmasq
	fi
}

reload_service() {
	rc_procd start_service "$@"
	return 0
}

	local instance="$1"
	local instance_found=0

	config_cb() {
		local type="$1"
		local name="$2"
		if [ "$type" = "dnsmasq" ]; then
			if [ -n "$instance" -a "$instance" = "$name" ]; then
				instance_found=1
			fi
		fi

	config_load dhcp

	if [ -n "$instance" ]; then
		[ "$instance_found" -gt 0 ] || return
		dnsmasq_stop "$instance"
	else
		config_foreach dnsmasq_stop dnsmasq
	fi