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