diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index 77f4e0d9c..e46a8dec5 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -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