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"
%>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<br />
<div style="width:30%; float:left">
- <input style="margin: 5px 0" type="text" value="<%=luci.config.diag.ping%>" name="ping" /><br />
+ <input style="margin: 5px 0" type="text" value="<%=ping_host%>" name="ping" /><br />
<% if has_ping6 then %>
<select name="ping_proto" style="width:auto">
<option value="" selected="selected"><%:IPv4%></option>
</div>
<div style="width:33%; float:left">
- <input style="margin: 5px 0" type="text" value="<%=luci.config.diag.route%>" name="traceroute" /><br />
+ <input style="margin: 5px 0" type="text" value="<%=route_host%>" name="traceroute" /><br />
<% if has_traceroute6 then %>
<select name="traceroute_proto" style="width:auto">
<option value="" selected="selected"><%:IPv4%></option>
</div>
<div style="width:33%; float:left;">
- <input style="margin: 5px 0" type="text" value="<%=luci.config.diag.dns%>" name="nslookup" /><br />
+ <input style="margin: 5px 0" type="text" value="<%=dns_host%>" name="nslookup" /><br />
<input type="button" value="<%:Nslookup%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.nslookup)" />
</div>