diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index 9de24add6..005e61364 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -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 + 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 - host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.openvpn.host_ip')" 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 + 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 - host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.mlvpn.host_ip')" 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 + 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 - host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.dsvpn.host_ip')" uci -q batch <<-EOF >/dev/null delete dhcp.@dnsmasq[0].server add_list dhcp.@dnsmasq[0].server="$host_ip#53"