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

Fix Pi-Hole IP

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-09-05 22:16:24 +02:00
parent 6b052c6cca
commit a78da33f37

View file

@ -286,6 +286,7 @@ _set_pihole() {
fi
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
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
@ -298,6 +299,7 @@ _set_pihole() {
fi
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
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
@ -310,8 +312,8 @@ _set_pihole() {
fi
fi
if [ "$vpn" = "openvpn" ]; then
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; 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
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
@ -323,8 +325,8 @@ _set_pihole() {
fi
fi
if [ "$vpn" = "mlvpn" ]; then
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; 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
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
@ -336,8 +338,8 @@ _set_pihole() {
fi
fi
if [ "$vpn" = "dsvpn" ]; then
if [ "$pihole" = "true" ] && [ "$(uci -q get dhcp.@dnsmasq[0].server)" != "$host_ip#53" ]; 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
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
add_list dhcp.@dnsmasq[0].server="$host_ip#53"