aboutsummaryrefslogtreecommitdiff
path: root/etc/local.d/02-dnsmasq.start
diff options
context:
space:
mode:
Diffstat (limited to 'etc/local.d/02-dnsmasq.start')
-rwxr-xr-xetc/local.d/02-dnsmasq.start23
1 files changed, 23 insertions, 0 deletions
diff --git a/etc/local.d/02-dnsmasq.start b/etc/local.d/02-dnsmasq.start
new file mode 100755
index 0000000..25b736c
--- /dev/null
+++ b/etc/local.d/02-dnsmasq.start
@@ -0,0 +1,23 @@
+#!/bin/sh
+# Generate dnsmasq configuration
+. /etc/local.d/vars.sh
+conf="/etc/dnsmasq.conf"
+
+cat > "$conf" <<EOF
+no-resolv
+$(for server in $dns_servers ; do printf 'server=%s\n' $server ; done)
+domain-needed
+except-interface=$wan
+expand-hosts
+domain=$domain
+dhcp-range=$dhcp_range
+# This is the default
+#dhcp-leasefile=/var/lib/misc/dnsmasq.leases
+dhcp-authoritative
+EOF
+
+echo "Generated dnasmasq config:"
+
+cat $conf
+
+. /etc/local.d/vars_end.sh