mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix when vpn is set to glorytun UDP on VPS
This commit is contained in:
parent
9fea5af65d
commit
b2139f72b0
1 changed files with 15 additions and 2 deletions
|
@ -74,6 +74,8 @@ _set_glorytun_vps() {
|
|||
local settings
|
||||
settings='{"port": '$port',"key":"'$key'", "chacha": "'$chacha'"}'
|
||||
echo $(_set_json "glorytun" "$settings")
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -98,6 +100,8 @@ _set_openvpn_vps() {
|
|||
local settings
|
||||
settings='{"port": '$port',"key":"'$key'"}'
|
||||
echo $(_set_json "openvpn" "$settings")
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -176,6 +180,7 @@ _get_vps_config() {
|
|||
glorytun_change=0
|
||||
if [ "$vpn" = "glorytun_tcp" ]; then
|
||||
glorytun_state=1
|
||||
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')"
|
||||
if [ "$client_ip" != "dhcp" ] && [ -n "$client_ip" ]; then
|
||||
|
@ -222,6 +227,7 @@ _get_vps_config() {
|
|||
fi
|
||||
if [ "$vpn" = "glorytun_udp" ]; then
|
||||
glorytun_state=1
|
||||
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')"
|
||||
if [ "$client_ip" != "dhcp" ] && [ -n "$client_ip" ]; then
|
||||
|
@ -309,10 +315,13 @@ _set_redirect_ports_from_vps() {
|
|||
redirect_ports_current="$(echo "$vps_config" | jsonfilter -q -e '@.shorewall.redirect_ports')"
|
||||
[ "$redirect_ports" = "1" ] && redirect_ports_request="enable"
|
||||
[ "$redirect_ports" = "0" ] && redirect_ports_request="disable"
|
||||
[ "$redirect_ports_request" != "$redirect_ports_current" ] && {
|
||||
if [ "$redirect_ports_request" != "$redirect_ports_current" ]; then
|
||||
settings='{"redirect_ports": "'$redirect_ports_request'"}'
|
||||
echo $(_set_json "shorewall" "$settings")
|
||||
}
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
_set_mptcp_vps() {
|
||||
|
@ -340,6 +349,8 @@ _set_mptcp_vps() {
|
|||
if [ "$mptcp_enabled_current" != "$mptcp_enabled" ] || [ "$checksum_current" != "$checksum" ] || [ "$path_manager_current" != "$path_manager" ] || [ "$scheduler_current" != "$scheduler" ] || [ "$syn_retries_current" != "$syn_retries" ] || [ "$congestion_control_current" != "$congestion" ]; then
|
||||
settings='{"enabled" : "'$mptcp_enabled'", "checksum": "'$checksum'","path_manager": "'$path_manager'","scheduler": "'$scheduler'","syn_retries": "'$syn_retries'","congestion_control": "'$congestion'"}'
|
||||
echo $(_set_json "mptcp" "$settings")
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -352,6 +363,8 @@ _set_vpn_vps() {
|
|||
if [ "$vpn_current" != "$vpn" ]; then
|
||||
settings='{"vpn" : "'$vpn'"}'
|
||||
echo $(_set_json "vpn" "$settings")
|
||||
else
|
||||
echo 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue