<%# Copyright 2008 Steven Barth Copyright 2008 Jo-Philipp Wich Copyright 2011 Manuel Munz Licensed to the public under the Apache License 2.0. -%> <% has_ipv4_conf = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion") has_ipv6_conf = luci.model.uci.cursor():get_first("olsrd6", "olsrd", "IpVersion") 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_v4 then write_conf("/etc/config/olsrd", "olsrd") return false end if conf.openwrt_v6 then write_conf("/etc/config/olsrd6", "olsrd6") return false end if conf.conf_v4 then write_conf("/var/etc/olsrd.conf", "olsrd.conf") return false end if conf.conf_v6 then write_conf("/var/etc/olsrd6.conf", "olsrd6.conf") return false end %> <%+header%>

OLSR <%:Overview%>

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