unbound: add uci-default script
[project/luci.git] / applications / luci-app-unbound / root / etc / uci-defaults / 60_luci-unbound
1 #!/bin/sh
2
3 uci -q batch <<-EOF >/dev/null
4   delete ucitrack.@unbound[-1]
5   add ucitrack unbound
6   set ucitrack.@unbound[-1].init=unbound
7   commit ucitrack
8 EOF
9
10 rm -f /tmp/luci-indexcache
11 [ ! -x /usr/sbin/unbound-control ] && exit 0
12
13 uci -q batch <<-EOF >/dev/null
14   set luci.unboundhosts=command
15   set luci.unboundhosts.name='Unbound Local Hosts'
16   set luci.unboundhosts.command='unbound-control -c /var/lib/unbound/unbound.conf list_local_data'
17   set luci.unboundzones=command
18   set luci.unboundzones.name='Unbound Local Zones'
19   set luci.unboundzones.command='unbound-control -c /var/lib/unbound/unbound.conf list_local_zones'
20   commit luci
21 EOF
22
23 rm -f /tmp/luci-indexcache
24 exit 0
25