Merge pull request #1002 from EricLuehrsen/unbound_uci_defaults
authorHannu Nyman <hannu.nyman@iki.fi>
Sun, 12 Feb 2017 08:41:17 +0000 (10:41 +0200)
committerGitHub <noreply@github.com>
Sun, 12 Feb 2017 08:41:17 +0000 (10:41 +0200)
unbound: add uci-default script

applications/luci-app-unbound/root/etc/uci-defaults/60_luci-unbound [new file with mode: 0644]

diff --git a/applications/luci-app-unbound/root/etc/uci-defaults/60_luci-unbound b/applications/luci-app-unbound/root/etc/uci-defaults/60_luci-unbound
new file mode 100644 (file)
index 0000000..cc714ac
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+uci -q batch <<-EOF >/dev/null
+  delete ucitrack.@unbound[-1]
+  add ucitrack unbound
+  set ucitrack.@unbound[-1].init=unbound
+  commit ucitrack
+EOF
+
+rm -f /tmp/luci-indexcache
+[ ! -x /usr/sbin/unbound-control ] && exit 0
+
+uci -q batch <<-EOF >/dev/null
+  set luci.unboundhosts=command
+  set luci.unboundhosts.name='Unbound Local Hosts'
+  set luci.unboundhosts.command='unbound-control -c /var/lib/unbound/unbound.conf list_local_data'
+  set luci.unboundzones=command
+  set luci.unboundzones.name='Unbound Local Zones'
+  set luci.unboundzones.command='unbound-control -c /var/lib/unbound/unbound.conf list_local_zones'
+  commit luci
+EOF
+
+rm -f /tmp/luci-indexcache
+exit 0
+