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

Default dsvpn config

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-12-03 11:32:03 +01:00
parent cc9f3c9fe6
commit a5cec1b0fd

View file

@ -74,11 +74,18 @@ if [ "$(uci -q get dsvpn.vpn)" = "" ]; then
set dsvpn.vpn.port=65011
set dsvpn.vpn.localip=10.255.251.2
set dsvpn.vpn.remoteip=10.255.251.1
set dsvpn.vpn.mode=client
set dsvpn.vpn.enable=0
commit dsvpn
EOF
fi
if [ "$(uci -q get dsvpn.vpn.mode)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set dsvpn.vpn.mode=client
commit dsvpn
EOF
fi
if [ "$(uci -q show firewall | grep omrvpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null
@ -100,6 +107,12 @@ if [ "$(uci -q get ucitrack.@network[-1].affects | grep glorytun)" = "" ]; then
commit ucitrack
EOF
fi
if [ "$(uci -q get ucitrack.@network[-1].affects | grep glorytun-udp)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add_list ucitrack.@network[-1].affects="glorytun-udp"
commit ucitrack
EOF
fi
if [ "$(uci -q get ucitrack.@network[-1].affects | grep dsvpn)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add_list ucitrack.@network[-1].affects="dsvpn"
@ -112,6 +125,28 @@ if [ "$(uci -q get ucitrack.@glorytun[-1].affects | grep openmptcprouter-vps)" =
commit ucitrack
EOF
fi
if [ "$(uci -q get ucitrack.@glorytun-udp[-1].affects | grep openmptcprouter-vps)" = "" ]; then
uci -q batch <<-EOF >/dev/null
add_list ucitrack.@glorytun-udp[-1].affects="openmptcprouter-vps"
commit ucitrack
EOF
fi
if [ "$(uci -q get glorytun-udp.vpn.key)" = "" ] && [ "$(uci -q get glorytun.vpn.key)" != "" ]; then
uci -q batch <<-EOF >/dev/null
set glorytun-udp.vpn.key=$(uci -q get glorytun.vpn.key)
set glorytun-udp.vpn.host=$(uci -q get glorytun.vpn.host)
EOF
if [ "$(uci -q get glorytun-udp.vpn.proto)" = "udp" ]; then
uci -q batch <<-EOF >/dev/null
set glorytun-udp.vpn.enable=1
set glorytun.vpn.enable=0
commit glorytun
EOF
fi
uci -q commit glorytun-udp
fi
rm -f /tmp/luci-indexcache