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

Fix restart dnsmasq with pihole

This commit is contained in:
Ycarus 2019-05-23 19:51:03 +02:00
parent f8b0638467
commit 943f1de544

View file

@ -180,6 +180,7 @@ _get_vps_config() {
set network.omrvpn.proto='none'
commit network
EOF
glorytun_change=1
fi
else
if [ "$(uci -q get glorytun.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun.vpn.localip)" != "" ]; then
@ -194,9 +195,10 @@ _get_vps_config() {
set network.omrvpn.proto='dhcp'
commit network
EOF
glorytun_change=1
fi
fi
if [ "$pihole" = "true" ]; then
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"
@ -223,6 +225,7 @@ _get_vps_config() {
set network.omrvpn.proto='none'
commit network
EOF
glorytun_change=1
fi
else
if [ "$(uci -q get glorytun.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun.vpn.localip)" != "" ]; then
@ -237,9 +240,10 @@ _get_vps_config() {
set network.omrvpn.proto='dhcp'
commit network
EOF
glorytun_change=1
fi
fi
if [ "$pihole" = "true" ]; then
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"
@ -250,7 +254,7 @@ _get_vps_config() {
fi
fi
if [ "$vpn" = "openvpn" ]; then
if [ "$pihole" = "true" ]; 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')"
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server
@ -262,7 +266,7 @@ _get_vps_config() {
fi
fi
if [ "$vpn" = "mlvpn" ]; then
if [ "$pihole" = "true" ]; 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')"
uci -q batch <<-EOF >/dev/null
delete dhcp.@dnsmasq[0].server