1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

Fix pihole support

This commit is contained in:
Ycarus 2019-05-12 08:58:30 +02:00
parent a85cc0ea6e
commit 7342d821a3

View file

@ -197,8 +197,12 @@ _get_vps_config() {
fi
fi
if [ "$pihole" = "true" ]; then
uci -q set dhcp.@dnsmasq[0].server="$host_ip#53"
uci -q set dhcp.@dnsmasq[0].rebind_protection='0'
uci -q batch <<-EOF >/dev/null
set dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
EOF
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
fi
if [ "$vpn" = "glorytun_udp" ]; then
@ -235,22 +239,34 @@ _get_vps_config() {
fi
fi
if [ "$pihole" = "true" ]; then
uci -q set dhcp.@dnsmasq[0].server="$host_ip#53"
uci -q set dhcp.@dnsmasq[0].rebind_protection='0'
uci -q batch <<-EOF >/dev/null
set dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
EOF
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
fi
if [ "$vpn" = "openvpn" ]; then
if [ "$pihole" = "true" ]; then
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.openvpn.host_ip')"
uci -q set dhcp.@dnsmasq[0].server="$host_ip#53"
uci -q set dhcp.@dnsmasq[0].rebind_protection='0'
uci -q batch <<-EOF >/dev/null
set dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
EOF
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
fi
if [ "$vpn" = "mlvpn" ]; then
if [ "$pihole" = "true" ]; then
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.mlvpn.host_ip')"
uci -q set dhcp.@dnsmasq[0].server="$host_ip#53"
uci -q set dhcp.@dnsmasq[0].rebind_protection='0'
uci -q batch <<-EOF >/dev/null
set dhcp.@dnsmasq[0].server="$host_ip#53"
set dhcp.@dnsmasq[0].rebind_protection='0'
commit dhcp
EOF
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
fi
if [ "$glorytun_change" != "0" ]; then