2018-02-20 16:10:59 +00:00
|
|
|
#!/bin/sh
|
2019-02-03 18:23:55 +00:00
|
|
|
if [ "$(uci -q get openmptcprouter.latest_versions)" = "" ]; then
|
2019-01-27 06:57:24 +00:00
|
|
|
if [ "$(uci -q get unbound.@unbound[0].listen_port | grep 5353)" = "" ]; then
|
|
|
|
uci -q batch <<-EOF >/dev/null
|
|
|
|
set unbound.@unbound[-1].listen_port=5353
|
|
|
|
set unbound.@unbound[-1].protocol="ip4_only"
|
|
|
|
set unbound.@unbound[-1].enabled=1
|
|
|
|
set unbound.@unbound[-1].recursion="aggressive"
|
|
|
|
commit unbound
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
if [ "$(uci -q show dhcp | grep 127.0.0.1#5353)" = "" ]; then
|
|
|
|
uci -q batch <<-EOF >/dev/null
|
|
|
|
add_list dhcp.@dnsmasq[-1].server="127.0.0.1#5353"
|
|
|
|
commit dhcp
|
|
|
|
EOF
|
|
|
|
fi
|
2018-05-23 08:56:23 +00:00
|
|
|
fi
|
2019-06-11 20:14:56 +00:00
|
|
|
if [ "$(uci -q get dhcp.@dnsmasq[0].rebind_domain)" = "" ]; then
|
|
|
|
uci -q batch <<-EOF >/dev/null
|
|
|
|
set dhcp.@dnsmasq[-1].noresolv=1
|
|
|
|
set dhcp.@dnsmasq[-1].nonegcache=1
|
|
|
|
del dhcp.@dnsmasq[-1].interface
|
|
|
|
add_list dhcp.@dnsmasq[-1].rebind_domain="plex.direct"
|
|
|
|
commit dhcp
|
|
|
|
EOF
|
|
|
|
fi
|
2018-12-17 16:01:22 +00:00
|
|
|
#uci -q batch <<-EOF >/dev/null
|
|
|
|
# set unbound.@unbound[-1].add_local_fqdn=0
|
|
|
|
# set unbound.@unbound[-1].localservice=1
|
|
|
|
# set unbound.@unbound[-1].rebind_localhost=0
|
|
|
|
# set unbound.@unbound[-1].rebind_protection=1
|
|
|
|
# set unbound.@unbound[-1].unbound_control=1
|
|
|
|
# commit unbound
|
|
|
|
#EOF
|
|
|
|
|
|
|
|
|
2018-02-20 16:10:59 +00:00
|
|
|
rm -f /tmp/luci-indexcache
|
|
|
|
|
|
|
|
exit 0
|