diff --git a/luci-mod-admin-full/luasrc/controller/admin/network.lua b/luci-mod-admin-full/luasrc/controller/admin/network.lua index aa86c184e..d07316f06 100644 --- a/luci-mod-admin-full/luasrc/controller/admin/network.lua +++ b/luci-mod-admin-full/luasrc/controller/admin/network.lua @@ -158,6 +158,12 @@ function index() page = entry({"admin", "network", "diag_speedtest"}, post("diag_speedtest"), nil) page.leaf = true + + page = entry({"admin", "network", "diag_getip"}, post("diag_getip"), nil) + page.leaf = true + + page = entry({"admin", "network", "diag_netstat"}, post("diag_netstat"), nil) + page.leaf = true -- end end @@ -438,6 +444,14 @@ function diag_iperf3(addr) diag_command("iperf3 -c %q 2>&1", addr) end +function diag_getip(addr) + diag_command("curl %q", addr) +end + +function diag_netstat(addr) + diag_command("netstat -lapute 2>&1", "openmptcprouter.com") +end + function diag_speedtest(addr) if addr then diag_command("speedtestc --server %q 2>&1", addr) diff --git a/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm b/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm index 6243b536c..9596578bb 100644 --- a/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm +++ b/luci-mod-admin-full/luasrc/view/admin_network/diagnostics.htm @@ -11,11 +11,14 @@ local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6") local has_traceroute6 = fs.access("/usr/bin/traceroute6") local has_speedtest = fs.access("/usr/sbin/speedtestc") local has_iperf3 = fs.access("/usr/bin/iperf3") +local has_curl = fs.access("/usr/bin/curl") +local has_netstat = fs.access("/bin/netstat") 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" local iperf3_host = luci.config.diag and luci.config.diag.iperf3 or "ping-ams1.online.net" +local getip_host = luci.config.diag and luci.config.diag.getip or "ifconfig.co" %> @@ -69,7 +72,7 @@ local iperf3_host = luci.config.diag and luci.config.diag.iperf3 or "ping-ams1.o
-
+

<% if has_ping6 then %>
<% if has_traceroute6 then %>
<% if has_speedtest and false then %> -
+

<% end %> <% if has_iperf3 then %> -
+

<% end %> + <% if has_curl then %> +
+
+ +
+ <% end %> + + <% if has_netstat then %> +
+
+ +
+ <% end %> +

diff --git a/openmptcprouter/files/etc/uci-defaults/1950-omr b/openmptcprouter/files/etc/uci-defaults/1950-omr index de14eb001..1cc14babc 100755 --- a/openmptcprouter/files/etc/uci-defaults/1950-omr +++ b/openmptcprouter/files/etc/uci-defaults/1950-omr @@ -5,6 +5,8 @@ uci -q batch <<-EOF >/dev/null set luci.diag.ping="openmptcprouter.com" set luci.diag.dns="openmptcprouter.com" set luci.diag.route="openmptcprouter.com" + set luci.diag.iperf3="ping-ams1.online.net" + set luci.diag.getip="ip.openmptcprouter.com" commit luci EOF rm -f /tmp/luci-indexcache