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:
parent
f8b0638467
commit
943f1de544
1 changed files with 8 additions and 4 deletions
|
@ -180,6 +180,7 @@ _get_vps_config() {
|
||||||
set network.omrvpn.proto='none'
|
set network.omrvpn.proto='none'
|
||||||
commit network
|
commit network
|
||||||
EOF
|
EOF
|
||||||
|
glorytun_change=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$(uci -q get glorytun.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun.vpn.localip)" != "" ]; then
|
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'
|
set network.omrvpn.proto='dhcp'
|
||||||
commit network
|
commit network
|
||||||
EOF
|
EOF
|
||||||
|
glorytun_change=1
|
||||||
fi
|
fi
|
||||||
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
|
uci -q batch <<-EOF >/dev/null
|
||||||
delete dhcp.@dnsmasq[0].server
|
delete dhcp.@dnsmasq[0].server
|
||||||
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
|
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
|
||||||
|
@ -223,6 +225,7 @@ _get_vps_config() {
|
||||||
set network.omrvpn.proto='none'
|
set network.omrvpn.proto='none'
|
||||||
commit network
|
commit network
|
||||||
EOF
|
EOF
|
||||||
|
glorytun_change=1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$(uci -q get glorytun.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun.vpn.localip)" != "" ]; then
|
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'
|
set network.omrvpn.proto='dhcp'
|
||||||
commit network
|
commit network
|
||||||
EOF
|
EOF
|
||||||
|
glorytun_change=1
|
||||||
fi
|
fi
|
||||||
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
|
uci -q batch <<-EOF >/dev/null
|
||||||
delete dhcp.@dnsmasq[0].server
|
delete dhcp.@dnsmasq[0].server
|
||||||
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
|
add_list dhcp.@dnsmasq[0].server="$host_ip#53"
|
||||||
|
@ -250,7 +254,7 @@ _get_vps_config() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$vpn" = "openvpn" ]; then
|
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')"
|
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.openvpn.host_ip')"
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
delete dhcp.@dnsmasq[0].server
|
delete dhcp.@dnsmasq[0].server
|
||||||
|
@ -262,7 +266,7 @@ _get_vps_config() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$vpn" = "mlvpn" ]; then
|
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')"
|
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.mlvpn.host_ip')"
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
delete dhcp.@dnsmasq[0].server
|
delete dhcp.@dnsmasq[0].server
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue