Fix services and xlinks (#1017)

This commit is contained in:
Tim Wilkinson 2023-12-13 22:49:28 -08:00 committed by GitHub
parent b702c1cfe7
commit 18e17abf97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -164,7 +164,7 @@ local function get(validate)
if link == "0" then
port = "0"
end
services[#services + 1] = string.format("%s://%s:%s/%s|tcp|%s\n", proto, host, port, sffx, name)
services[#services + 1] = string.format("%s://%s:%s/%s|tcp|%s", proto, host, port, sffx, name)
end
end
end

View File

@ -928,7 +928,7 @@ if nixio.fs.access("/etc/config.mesh/olsrd", "r") then
for _, host in ipairs(hosts)
do
if host.host ~= "" then
of:write("\toption " .. host.ip:gsub("%.", "_") .. " '" .. host.host .. "'\n")
of:write("\tlist hosts '" .. host.ip .. " " .. host.host .. "'\n")
end
end
for _, service in ipairs(services)
@ -971,7 +971,7 @@ if nixio.fs.access("/etc/config.mesh/olsrd", "r") then
if nixio.fs.stat("/etc/config.mesh/xlink") then
uci.cursor("/etc/config.mesh"):foreach("xlink", "interface",
function(section)
of:write("config Interface\n\t list interface '" .. section.ifname .. "'\n")
of:write("\nconfig Interface\n\tlist interface '" .. section[".name"] .. "'\n")
if section.peer then
of:write("\toption Ip4Broadcast '" .. section.peer .. "'\n")
else
@ -982,7 +982,7 @@ if nixio.fs.access("/etc/config.mesh/olsrd", "r") then
if weight > 1 then
of:write("\toption LinkQualityMult 'default " .. (1 / weight) .. "'\n")
elseif weight < 1 then
of:write([[ Mode "ether"]])
of:write("\toption Mode 'ether'\n")
end
else
of:write("\toption Mode 'ether'\n")