2016-10-06 15:13:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$(uci -q get luci.diag)" != "internal" ]; then
|
|
|
|
host=""
|
|
|
|
|
|
|
|
if [ -s /etc/os-release ]; then
|
|
|
|
. /etc/os-release
|
2019-06-26 09:24:19 +00:00
|
|
|
host="${HOME_URL:-${BUG_URL:-$OPENWRT_DEVICE_MANUFACTURER_URL}}"
|
2016-10-06 15:13:23 +00:00
|
|
|
host="${host#*://}"
|
|
|
|
host="${host%%/*}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
uci -q batch <<-EOF >/dev/null
|
|
|
|
set luci.diag=internal
|
|
|
|
set luci.diag.dns='${host:-openwrt.org}'
|
|
|
|
set luci.diag.ping='${host:-openwrt.org}'
|
|
|
|
set luci.diag.route='${host:-openwrt.org}'
|
|
|
|
commit luci
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|