1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix DNS support

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-07-20 10:22:43 +02:00
parent f1072bb2fb
commit f8a0bcad38

View file

@ -454,9 +454,9 @@ _get_pihole() {
if [ "$vpn" = "glorytun_tcp" ]; then
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.tcp.host_ip')"
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; then
if [ "$pihole" = "true" ] && [ -z "$(uci -q get dhcp.@dnsmasq[0].server | grep $host_ip)" ]; then
uci -q del_list dhcp.@dnsmasq[0].server="$(uci -q get dhcp.@dnsmasq[0].server | tr ' ' '\n' | grep '#53' | grep '10.2')"
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
@ -467,9 +467,9 @@ _get_pihole() {
fi
if [ "$vpn" = "glorytun_udp" ]; then
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.udp.host_ip')"
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; then
if [ "$pihole" = "true" ] && [ -z "$(uci -q get dhcp.@dnsmasq[0].server | grep $host_ip)" ]; then
uci -q del_list dhcp.@dnsmasq[0].server="$(uci -q get dhcp.@dnsmasq[0].server | tr ' ' '\n' | grep '#53' | grep '10.2')"
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
@ -480,9 +480,9 @@ _get_pihole() {
fi
if [ "$vpn" = "openvpn" ]; then
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.openvpn.host_ip')"
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; then
if [ "$pihole" = "true" ] && [ -z "$(uci -q get dhcp.@dnsmasq[0].server | grep $host_ip)" ]; then
uci -q del_list dhcp.@dnsmasq[0].server="$(uci -q get dhcp.@dnsmasq[0].server | tr ' ' '\n' | grep '#53' | grep '10.2')"
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
@ -493,9 +493,9 @@ _get_pihole() {
fi
if [ "$vpn" = "mlvpn" ]; then
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.mlvpn.host_ip')"
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; then
if [ "$pihole" = "true" ] && [ -z "$(uci -q get dhcp.@dnsmasq[0].server | grep $host_ip)" ]; then
uci -q del_list dhcp.@dnsmasq[0].server="$(uci -q get dhcp.@dnsmasq[0].server | tr ' ' '\n' | grep '#53' | grep '10.2')"
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
@ -506,9 +506,9 @@ _get_pihole() {
fi
if [ "$vpn" = "dsvpn" ]; then
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.dsvpn.host_ip')"
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; then
if [ "$pihole" = "true" ] && [ -z "$(uci -q get dhcp.@dnsmasq[0].server | grep $host_ip)" ]; then
uci -q del_list dhcp.@dnsmasq[0].server="$(uci -q get dhcp.@dnsmasq[0].server | tr ' ' '\n' | grep '#53' | grep '10.2')"
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp