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

Set DHCP by default for all VPNs

This commit is contained in:
Ycarus 2019-02-04 20:08:49 +01:00
parent 203277462c
commit 223ce87a72
2 changed files with 29 additions and 5 deletions

View file

@ -239,7 +239,7 @@ function wizard_add()
if default_vpn:match("^glorytun.*") then
vpn_port = 65001
vpn_intf = "tun0"
ucic:set("network","omrvpn","proto","none")
ucic:set("network","omrvpn","proto","dhcp")
elseif default_vpn == "mlvpn" then
vpn_port = 65201
vpn_intf = "mlvpn0"

View file

@ -173,14 +173,26 @@ _get_vps_config() {
EOF
glorytun_change=1
fi
if [ "$(uci -q get network.omrvpn.proto)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set network.omrvpn.proto='none'
commit network
EOF
fi
else
if [ "$(uci -q get glorytun.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun.vpn.localip)" != "" ]; then
uci -q batch <<-EOF >/dev/null
del glorytun.vpn.localip
del glorytun.vpn.remoteip
delete glorytun.vpn.localip
delete glorytun.vpn.remoteip
EOF
glorytun_change=1
fi
if [ "$(uci -q get network.omrvpn.proto)" != "" ]; then
uci -q batch <<-EOF >/dev/null
set network.omrvpn.proto='dhcp'
commit network
EOF
fi
fi
fi
if [ "$vpn" = "glorytun_udp" ]; then
@ -195,14 +207,26 @@ _get_vps_config() {
EOF
glorytun_change=1
fi
if [ "$(uci -q get network.omrvpn.proto)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set network.omrvpn.proto='none'
commit network
EOF
fi
else
if [ "$(uci -q get glorytun.vpn.remoteip)" != "" ] || [ "$(uci -q get glorytun.vpn.localip)" != "" ]; then
uci -q batch <<-EOF >/dev/null
del glorytun.vpn.localip
del glorytun.vpn.remoteip
delete glorytun.vpn.localip
delete glorytun.vpn.remoteip
EOF
glorytun_change=1
fi
if [ "$(uci -q get network.omrvpn.proto)" != "" ]; then
uci -q batch <<-EOF >/dev/null
set network.omrvpn.proto='dhcp'
commit network
EOF
fi
fi
fi
if [ "$glorytun_change" != "0" ]; then