From: Manuel Munz Date: Sun, 11 Nov 2012 12:20:56 +0000 (+0000) Subject: admin-full/diagnostics: Allow to use ping6 and traceroute6 when available, #487 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=69dbc27ce0517c0bd414bbfb9cdff53fa968a3cd;p=oweals%2Fluci.git admin-full/diagnostics: Allow to use ping6 and traceroute6 when available, #487 --- diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua index 85dc68fff..6f55ff777 100644 --- a/modules/admin-full/luasrc/controller/admin/network.lua +++ b/modules/admin-full/luasrc/controller/admin/network.lua @@ -156,6 +156,12 @@ function index() page = entry({"admin", "network", "diag_traceroute"}, call("diag_traceroute"), nil) page.leaf = true + + page = entry({"admin", "network", "diag_ping6"}, call("diag_ping6"), nil) + page.leaf = true + + page = entry({"admin", "network", "diag_traceroute6"}, call("diag_traceroute6"), nil) + page.leaf = true -- end end @@ -463,3 +469,11 @@ end function diag_nslookup() diag_command("nslookup %q 2>&1") end + +function diag_ping6() + diag_command("ping6 -c 5 %q 2>&1") +end + +function diag_traceroute6() + diag_command("traceroute6 -q 1 -w 2 -n %q 2>&1") +end diff --git a/modules/admin-full/luasrc/view/admin_network/diagnostics.htm b/modules/admin-full/luasrc/view/admin_network/diagnostics.htm index a991f9a48..abbc90623 100644 --- a/modules/admin-full/luasrc/view/admin_network/diagnostics.htm +++ b/modules/admin-full/luasrc/view/admin_network/diagnostics.htm @@ -14,18 +14,33 @@ $Id$ <%+header%> +<% +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") +%> +