commit 8a34a54b6aa6 ("base-files: use OPENWRT prefix for os-release variables") changes the prefix of the os-release variables from LEDE_ to OPENWRT_. Use the new name. Signed-off-by: Bjørn Mork <bjorn@mork.no>
22 lines
461 B
Bash
Executable file
22 lines
461 B
Bash
Executable file
#!/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
|