luci-app-wireguard: fix allowed_ip parsing
Signed-off-by: lvoegl <lvoegl@tdt.de>
This commit is contained in:
parent
7c943a1d6b
commit
193abe7221
1 changed files with 13 additions and 14 deletions
|
@ -93,9 +93,7 @@ local methods = {
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
table.insert(
|
local peer = {
|
||||||
data[line[1]].peers,
|
|
||||||
{
|
|
||||||
name = peer_name,
|
name = peer_name,
|
||||||
public_key = line[2],
|
public_key = line[2],
|
||||||
endpoint = line[4],
|
endpoint = line[4],
|
||||||
|
@ -105,16 +103,17 @@ local methods = {
|
||||||
transfer_tx = line[8],
|
transfer_tx = line[8],
|
||||||
persistent_keepalive = line[9]
|
persistent_keepalive = line[9]
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
||||||
if not (line[4] == "(none)") then
|
if not (line[4] == "(none)") then
|
||||||
local ipkey, ipvalue
|
local ipkey, ipvalue
|
||||||
for ipkey, ipvalue in pairs(string.split(line[5], ",")) do
|
for ipkey, ipvalue in pairs(string.split(line[5], ",")) do
|
||||||
if #ipvalue > 0 then
|
if #ipvalue > 0 then
|
||||||
table.insert(data[line[1]].peers[peer_name]["allowed_ips"], ipvalue)
|
table.insert(peer["allowed_ips"], ipvalue)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
table.insert(data[line[1]].peers, peer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue