<%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth Copyright 2008 Jo-Philipp Wich Copyright 2011 Manuel Munz 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 ipv = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion", "4") function write_conf(conf, file) local fs = require "nixio.fs" if fs.access(conf) then luci.http.header("Content-Disposition", "attachment; filename="..file) luci.http.prepare_content("text/plain") luci.http.write(fs.readfile(conf)) end end conf = luci.http.formvalue() if conf.openwrt then write_conf("/etc/config/olsrd", "olsrd") return false end if conf.conf_v4 then write_conf("/var/etc/olsrd.conf.ipv4", "olsrd.conf.ipv4") return false end if conf.conf_v6 then write_conf("/var/etc/olsrd.conf.ipv6", "olsrd.conf.ipv6") return false end if conf.conf then write_conf("/var/etc/olsrd.conf", "olsrd.conf") return false end %> <%+header%>

OLSR <%:Overview%>

<%:Network%>
<%:Interfaces%> -
<%:Neighbors%> -
<%:Nodes%> -
<%:HNA%> -
<%:Links total%> -
<%:Links per node (average)%> -
OLSR <%:Configuration%>
<%:Version%> -
<%:Download Config%> OpenWrt, <% if ipv == "6and4" then %> OLSRD IPv4, OLSRD IPv6 <% else %> OLSRD <% end %>
<%+footer%>