Skip to content
Snippets Groups Projects
Unverified Commit 9be7a5ca authored by David Bauer's avatar David Bauer Committed by GitHub
Browse files

gluon-wan-dnsmasq: read interfaces to update from flag-files (#2060)

This commit changes the behavior for the wan-dnsmasq to read the
interfaces to update the DNS servers on from flag-files.

This way, external custom packages which add a custom VPN WAN interface
can update the DNS server gluon is using for WAN resolving.
parent 2be6fe32
Branches
No related tags found
No related merge requests found
......@@ -16,6 +16,19 @@ local function append_server(server)
end
local function handled_interfaces()
local interfaces = {}
for _, path in ipairs(util.glob('/lib/gluon/wan-dnsmasq/interface.d/*')) do
for interface in io.lines(path) do
table.insert(interfaces, interface)
end
end
return interfaces
end
local function handle_interface(status)
local ifname = status.device
local servers = status.inactive['dns-server']
......@@ -41,8 +54,9 @@ if type(static) == 'table' and #static > 0 then
append_server(server)
end
else
pcall(append_interface_servers, 'wan6')
pcall(append_interface_servers, 'wan')
for _, interface in ipairs(handled_interfaces()) do
pcall(append_interface_servers, interface)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment