From: Jo-Philipp Wich Date: Sun, 31 Jul 2016 13:59:58 +0000 (+0200) Subject: luci-mod-admin-full: fix net diagnostics with missing config X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=1367f7b624e9ee926cdbd3235a9fec4450c904b5;ds=sidebyside luci-mod-admin-full: fix net diagnostics with missing config Gracefully handle a missing diag section in /etc/config/luci when rendering the network diagnostics tool page. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm index 90d711717..f4adb2606 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm @@ -9,6 +9,10 @@ local fs = require "nixio.fs" local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6") local has_traceroute6 = fs.access("/usr/bin/traceroute6") + +local dns_host = luci.config.diag and luci.config.diag.dns or "dev.openwrt.org" +local ping_host = luci.config.diag and luci.config.diag.ping or "dev.openwrt.org" +local route_host = luci.config.diag and luci.config.diag.route or "dev.openwrt.org" %> @@ -63,7 +67,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
-
+
<% if has_ping6 then %>
+
<% if has_traceroute6 then %>
+