From d8f97eaaf7db685ddf11396ec08e0c440d214da1 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Fri, 22 Jun 2018 12:31:35 +0200 Subject: [PATCH] Fix list of available protocols --- .../luasrc/view/omr-bypass/bypass.htm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/luci-app-omr-bypass/luasrc/view/omr-bypass/bypass.htm b/luci-app-omr-bypass/luasrc/view/omr-bypass/bypass.htm index 756720fa1..4ba75a427 100644 --- a/luci-app-omr-bypass/luasrc/view/omr-bypass/bypass.htm +++ b/luci-app-omr-bypass/luasrc/view/omr-bypass/bypass.htm @@ -10,7 +10,6 @@ local tmpfile = os.tmpname() local dpi_available_proto = luci.util.execi("cat /proc/net/xt_ndpi/proto | awk '{print $3}' | sort -u | head -n -1") %> - <% if stderr and #stderr > 0 then %>
<%=pcdata(stderr)%>
<% end %>
@@ -64,12 +63,21 @@
- <% +<% local allprt="""" - for prt in dpi_available_proto do - allprt=allprt .. ","" .. prt .. """ + local protos = {} + for l in io.lines("/proc/net/xt_ndpi/proto") do + local a,b,c,d = l:match('(%w+) (%w+)') + if b ~= "2" and not string.match(b,"custom") then + table.insert(protos,b) + end end - %> + table.sort(protos) + for _,b in ipairs(protos) do + allprt=allprt .. ","" .. b .. """ + end +%> +
<%