parent
cb6d31123f
commit
4e2888f7a2
@ -11,6 +11,10 @@ local fs = require 'nixio.fs'
|
|||||||
|
|
||||||
local new_servers = ''
|
local new_servers = ''
|
||||||
|
|
||||||
|
local function append_server(server)
|
||||||
|
new_servers = new_servers .. 'nameserver ' .. server .. '\n'
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function handle_interface(status)
|
local function handle_interface(status)
|
||||||
local ifname = status.device
|
local ifname = status.device
|
||||||
@ -18,9 +22,10 @@ local function handle_interface(status)
|
|||||||
|
|
||||||
for _, server in ipairs(servers) do
|
for _, server in ipairs(servers) do
|
||||||
if server:match('^fe80:') then
|
if server:match('^fe80:') then
|
||||||
server = server .. '%' .. ifname
|
append_server(server .. '%' .. ifname)
|
||||||
|
else
|
||||||
|
append_server(server)
|
||||||
end
|
end
|
||||||
new_servers = new_servers .. 'nameserver ' .. server .. '\n'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -32,7 +37,9 @@ end
|
|||||||
local static = uci:get_first('gluon-wan-dnsmasq', 'static', 'server')
|
local static = uci:get_first('gluon-wan-dnsmasq', 'static', 'server')
|
||||||
|
|
||||||
if type(static) == 'table' and #static > 0 then
|
if type(static) == 'table' and #static > 0 then
|
||||||
append_servers(static)
|
for _, server in ipairs(static) do
|
||||||
|
append_server(server)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
pcall(append_interface_servers, 'wan6')
|
pcall(append_interface_servers, 'wan6')
|
||||||
pcall(append_interface_servers, 'wan')
|
pcall(append_interface_servers, 'wan')
|
||||||
|
Loading…
Reference in New Issue
Block a user