diff --git a/files/www/cgi-bin/ports b/files/www/cgi-bin/ports index 3ebee4ab..43e9f64a 100755 --- a/files/www/cgi-bin/ports +++ b/files/www/cgi-bin/ports @@ -1100,6 +1100,17 @@ function print_forwarding() end function print_services() + local activesvc = nil + if nixio.fs.stat("/var/etc/olsrd.conf") then + activesvc = {} + for line in io.lines("/var/etc/olsrd.conf") + do + local plparam = line:match([[^%s*(PlParam "service" ".*")%s*$]]) + if plparam then + activesvc[plparam] = true + end + end + end html.print("") if not (dmz_mode ~= 0 or parms.port_num ~= 0 or parms.dmz_ip) then if dmz_mode ~= 0 then @@ -1192,11 +1203,15 @@ function print_services() html.print("") + local svc = string.format([[PlParam "service" "%s://%s:%s/%s|tcp|%s"]], _proto, _host, (_link == "1" and _port or "0"), _suffix, _name) + if val ~= "_add" and activesvc and not activesvc[svc] then + html.print("") + end + html.print("") -- display any errors while #serv_err > 0 and serv_err[1]:match("^" .. val .. " ")
Advertised Services
 ") else - html.print("serv" .. val .. "_del value=Del title='Remove this service'") + html.print("serv" .. val .. "_del value=Del title='Remove this service'>") end - html.print(">