summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/root/etc/uci-defaults/50_luci-mod-admin-full
blob: 140c8329977d09c1406c97a46afe60b89f8066dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

if [ "$(uci -q get luci.diag)" != "internal" ]; then
	host=""

	if [ -s /etc/os-release ]; then
		. /etc/os-release
		host="${HOME_URL:-${BUG_URL:-$OPENWRT_DEVICE_MANUFACTURER_URL}}"
		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