mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix glorytun port from VPS
This commit is contained in:
parent
30a4c49bc7
commit
8642836d58
1 changed files with 3 additions and 4 deletions
|
@ -178,7 +178,7 @@ _get_vps_config() {
|
|||
uci -q set glorytun.vpn.proto='tcp'
|
||||
client_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.tcp.client_ip')"
|
||||
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.tcp.host_ip')"
|
||||
port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.tcp.port')"
|
||||
port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.port')"
|
||||
if [ "$(uci -q get glorytun.vpn.port)" != "$port" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set glorytun.vpn.port=$port
|
||||
|
@ -222,7 +222,7 @@ _get_vps_config() {
|
|||
uci -q set glorytun.vpn.proto='udp'
|
||||
client_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.udp.client_ip')"
|
||||
host_ip="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.udp.host_ip')"
|
||||
port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.tcp.port')"
|
||||
port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.port')"
|
||||
if [ "$(uci -q get glorytun.vpn.port)" != "$port" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set glorytun.vpn.port=$port
|
||||
|
@ -671,7 +671,7 @@ _set_config_from_vps() {
|
|||
# Glorytun settings
|
||||
glorytun_key="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.key')"
|
||||
glorytun_port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.port')"
|
||||
if ([ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun.vpn.key)" ]) || ([ -n "$glorytun_port" ] && [ "$glorytun_port" != "$(uci -q get glorytun.vpn.port)" ]); then
|
||||
if ([ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun.vpn.key)" ]) || ([ -n "$glorytun_port" ] || [ "$glorytun_port" != "$(uci -q get glorytun.vpn.port)" ]); then
|
||||
vpn="$(uci -q get openmptcprouter.settings.vpn)"
|
||||
glorytun_state=0
|
||||
if [ "$vpn" = "glorytun_tcp" ]; then
|
||||
|
@ -680,7 +680,6 @@ _set_config_from_vps() {
|
|||
if [ "$vpn" = "glorytun_udp" ]; then
|
||||
glorytun_state=1
|
||||
fi
|
||||
glorytun_port="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.port')"
|
||||
[ -z "$glorytun_port" ] && glorytun_port="65001"
|
||||
glorytun_chacha="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.chacha')"
|
||||
[ -z "$glorytun_chacha" ] || [ "$glorytun_chacha" = "true" ] && glorytun_chacha=1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue