<%# 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() %> <% if on_key_exists and on_crt_exists then %>

<%:Status Internet-Sharing%>

<% if (ugw_status.centralip_status == "ok") then %> <%:Internet shared%> ( <%:Usergateway-Tunnel active%>, <%:Central Gateways connected locally%> ) <% elseif ugw_status.tunnel_active then %> <%:Internet not shared%> ( <%:Internet-Sharing enabled%>, <%:Usergateway-Tunnel active%> ) <% elseif ugw_status.sharing_enabled then %> <%:Internet not shared%> ( <%:Internet-Sharing enabled%>, <%:Usergateway-Tunnel not running%> ) <% elseif ugw_status.sharing_possible then %> <%:Internet not shared%>, <%:Internet-Sharing possible%> <% else %> <%:Internet-Sharing impossible%> <% end %>

<% if ugw_status.tunnel_active then %>
 
<% end %>
<% if ugw_status.sharing_possible or ugw_status.sharing_enabled then %>

<%:Manage Internet-Sharing%>

<% if ugw_status.sharing_enabled then %>
<% else %>
<% end %>
<% if (ugw_status.sharing_blocked and ugw_status.sharing_blocked > "0") then %>
<% end if ugw_status.sharing_enabled then %>
<% end %>
<% end %> <% end %>

<%:Usergateway-Status%>

<% if ugw_status.sharing_possible then %> <%:Internet-Sharing possible%> <% else %> <%:Internet-Sharing impossible%> <% end %>

<% if ugw_status.sharing_wan_ok then %> <% end %> <% if ugw_status.sharing_wan_ok then %> <% end local count = 1 while count <= ugw_status.usergateways_no do local onusergw = cursor:get_all("on-usergw", "opennet_ugw"..count) local openvpn = cursor:get_all("openvpn", "opennet_ugw"..count) local ugw_tunnel_active = "error" if nixio.fs.access("/tmp/opennet_ugw-"..openvpn.remote..".txt") then ugw_tunnel_active = "ok" end %> <% if ugw_status.sharing_wan_ok then %> <% end %> <% count = count + 1 end %> <% else %> <% if ugw_status.sharing_wan_ok and on_key_exists and on_crt_exists then %> <% end %> <% end %>
<% print(luci.i18n.string([[WAN]])) %> <% print(luci.i18n.string([[Ping-Test]])) %><% print(luci.i18n.string([[MTU to Gateway]])) %> <% print(luci.i18n.string([[MTU from Gateway]])) %><% print(luci.i18n.string([[MTU-Status]])) %> <%:Tunnel-Status%>
<%:configured%> <%:measured%> <%:configured%> <%:measured%>

<%=openvpn.remote%>

 
 
<%=onusergw.mtu_toGW_tried%>
<%=onusergw.mtu_toGW_actual%>
<%=onusergw.mtu_fromGW_tried%>
<%=onusergw.mtu_fromGW_actual%>
 
 
<% if ugw_status.checkWANMTUrunning then %> <%:check running, please wait for the results%>

<%:Status%>

<% if on_csr_exists or (not(on_key_exists) and not(on_crt_exists)) then %>
<% if on_csr_exists then %><%:exists%><% else %><%:missing%><% end %> <% if on_csr_exists then %><%:download%><% end %>
<% end %>
<% if on_key_exists then %><%:exists%><% else %><%:missing%><% end %> <% if on_key_exists then %><%:download%><% end %>
<% if on_crt_exists then %><%:exists%><% else %><%:missing%><% end %> <% if on_crt_exists then %><%:download%><% end %>
<% if on_csr_exists and not(on_crt_exists) then local uci = require "luci.model.uci" local cursor = uci.cursor() local contact_email = cursor:get("on-core", "defaults", "csr_contact") local on_id = cursor:get("on-core", "settings", "on_id") print(luci.i18n.stringf([[Send Certificate Request (.csr) and only this file to %s in order to get the required certificate.]], contact_email, on_id, contact_email )) end %>