50_luci-mod-admin-full 461 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. if [ "$(uci -q get luci.diag)" != "internal" ]; then
  3. host=""
  4. if [ -s /etc/os-release ]; then
  5. . /etc/os-release
  6. host="${HOME_URL:-${BUG_URL:-$OPENWRT_DEVICE_MANUFACTURER_URL}}"
  7. host="${host#*://}"
  8. host="${host%%/*}"
  9. fi
  10. uci -q batch <<-EOF >/dev/null
  11. set luci.diag=internal
  12. set luci.diag.dns='${host:-openwrt.org}'
  13. set luci.diag.ping='${host:-openwrt.org}'
  14. set luci.diag.route='${host:-openwrt.org}'
  15. commit luci
  16. EOF
  17. fi
  18. exit 0