<%# Opennet Firmware Copyright 2010 Rene Ejury Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -%> <% local uci = require "luci.model.uci" local cursor = uci.cursor() %> <%+header%>

<%:on_gateways_title%>

<%:on_gateways_config_title%> <% if show_more_info then %>

<%:on_gateways_config_desc%> <% else %>
<% end %>

<%:on_gateways_list%>

<%:on_gateways_autosearch%> <% local autosearch = (cursor:get("on-openvpn", "gateways", "autosearch") == "on") if autosearch then %> <%:on_gateways_autosearch_activated%> <% else %> <%:on_gateways_autosearch_deactivated%> <% end %>

<% if autosearch then local sort_by_etx = (cursor:get("on-openvpn", "gateways", "vpn_sort_criteria") == "etx") %>

Sortierung nach <% if sort_by_etx then %> <%:on_gateways_autosearch_sortETX%> <% else %> <%:on_gateways_autosearch_sortMetric%> <% end %>

<% end %>
<% local name local count = 1 local number_of_gateways = 0 os.execute("echo '/route' | nc localhost 2006 > /tmp/olsrd_txtinfo.txt") os.execute("on_vpngateway_check check_blacklisting >/dev/null") cursor:unload("on-openvpn") cursor:foreach ("on-openvpn", "gateway", function() number_of_gateways = number_of_gateways + 1 end) while count <= number_of_gateways do local v = cursor:get_all("on-openvpn", "gate_"..count) if v and v[".type"] == "gateway" then if v.name then name = v.name else name = "..." end local active if v.ipaddr == cursor:get("openvpn", "opennet_user", "remote") then if (nixio.fs.access("/tmp/openvpn_msg.txt")) then active="y" else active="n" end end %> <% if not autosearch then %> <% end %> <% end count = count + 1 end nixio.fs.remove("/tmp/olsrd_txtinfo.txt") %> <% if not autosearch then %> <% end %>
<%:on_gateways_list_active%> <%:on_gateways_list_address%> <%:on_gateways_list_name%> <%:on_gateways_list_distance%> <%:on_gateways_list_status%> <%:on_gateways_list_age%>
<%=count%>
 

<%=v.ipaddr%>

<%=name%>
<% local output=luci.sys.exec("awk 'BEGIN {FS=\"[/\\x09]+\"} \$1~\""..v.ipaddr.."\" {print \$4\" / \"\$5}' /tmp/olsrd_txtinfo.txt") %><%=output%>
 
<%=v.age%>
<% if count ~= 1 then %> <% end %> <% if count ~= number_of_gateways then %> <% end %>
<% local better_gw=cursor:get("on-openvpn", "gateways", "better_gw") if ( better_gw ~= "0") then %> <%:on_gateways_change_notification_prefix%><%=6-better_gw%><%=on_gateways_reset_age%><%:on_gateways_change_notification_postfix%> <% end %>

<%:on_gateways_blacklist_title%>

<% name = "" for k, v in pairs(cursor:get_all("on-openvpn")) do if v[".type"] == "blacklist_gateway" then %> <% end end %>
<%:on_gateways_blacklist_address%> <%:on_gateways_blacklist_name%>

<%=v.ipaddr%>

<%=v.name%>
<%+footer%>