summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-network/root/etc
diff options
context:
space:
mode:
authorDaniel F. Dickinson <cshored@thecshore.com>2018-08-03 12:36:51 -0400
committerJo-Philipp Wich <jo@mein.io>2018-09-19 20:08:19 +0200
commit58d97b5e271bc0d7507eab5b9bd2902181864e02 (patch)
tree80e250346ad33c79b3f821daf7b7d9be90d99240 /modules/luci-mod-network/root/etc
parent6ec0353201435e0d0d7d32820d8ba600b4ca7b5b (diff)
modules: Split luci-mod-full
Move some common elements to luci-base, and otherwise make three packages out of status, system, and network. They were mostly separated already, but there were some shared elements between status and network that are now in luci-base. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Diffstat (limited to 'modules/luci-mod-network/root/etc')
-rwxr-xr-xmodules/luci-mod-network/root/etc/uci-defaults/50_luci-mod-admin-full22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/luci-mod-network/root/etc/uci-defaults/50_luci-mod-admin-full b/modules/luci-mod-network/root/etc/uci-defaults/50_luci-mod-admin-full
new file mode 100755
index 0000000000..372eb15122
--- /dev/null
+++ b/modules/luci-mod-network/root/etc/uci-defaults/50_luci-mod-admin-full
@@ -0,0 +1,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:-$LEDE_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