Merge pull request #787 from rogerpueyo/luci-proto-ipip
[project/luci.git] / modules / luci-mod-admin-full / root / etc / uci-defaults / 50_luci-mod-admin-full
1 #!/bin/sh
2
3 if [ "$(uci -q get luci.diag)" != "internal" ]; then
4         host=""
5
6         if [ -s /etc/os-release ]; then
7                 . /etc/os-release
8                 host="${HOME_URL:-${BUG_URL:-$LEDE_DEVICE_MANUFACTURER_URL}}"
9                 host="${host#*://}"
10                 host="${host%%/*}"
11         fi
12
13         uci -q batch <<-EOF >/dev/null
14                 set luci.diag=internal
15                 set luci.diag.dns='${host:-openwrt.org}'
16                 set luci.diag.ping='${host:-openwrt.org}'
17                 set luci.diag.route='${host:-openwrt.org}'
18                 commit luci
19         EOF
20 fi
21
22 exit 0