mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Fix OMR VPS status
This commit is contained in:
parent
1732e66a16
commit
f89fd05701
1 changed files with 13 additions and 13 deletions
|
@ -54,16 +54,16 @@ _set_json() {
|
|||
_set_glorytun_vps() {
|
||||
local enabled port key
|
||||
enabled="$(uci -q get glorytun.vpn.enable)"
|
||||
[ "$enabled" != "1" ] && return "Glorytun disabled"
|
||||
[ "$enabled" != "1" ] && echo "Glorytun disabled"
|
||||
port="$(uci -q get glorytun.vpn.port)"
|
||||
key="$(uci -q get glorytun.vpn.key)"
|
||||
chacha="$(uci -q get glorytun.vpn.chacha20)"
|
||||
if [ "$chacha" = "1" ]; then
|
||||
chacha = "true"
|
||||
chacha="true"
|
||||
else
|
||||
chacha = "false"
|
||||
chacha="false"
|
||||
fi
|
||||
[ -z "$key" ] && return "Glorytun key not set"
|
||||
[ -z "$key" ] && echo "Glorytun key not set"
|
||||
local current_port current_key current_chacha
|
||||
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
|
||||
[ -z "$vps_config" ] && return
|
||||
|
@ -73,14 +73,14 @@ _set_glorytun_vps() {
|
|||
if [ "$current_port" != "$port" ] || [ "$current_key" != "$key" ] || [ "$current_chacha" != "$chacha" ]; then
|
||||
local settings
|
||||
settings='{"port": '$port',"key":"'$key'", "chacha": "'$chacha'"}'
|
||||
return $(_set_json "glorytun" "$settings")
|
||||
echo $(_set_json "glorytun" "$settings")
|
||||
fi
|
||||
}
|
||||
|
||||
_set_openvpn_vps() {
|
||||
local enabled port key
|
||||
enabled="$(uci -q get openvpn.omr.enabled)"
|
||||
[ "$enabled" != "1" ] && return "OpenVPN disabled"
|
||||
[ "$enabled" != "1" ] && echo "OpenVPN disabled"
|
||||
port="$(uci -q get openvpn.omr.port)"
|
||||
keyfile="$(uci -q get openvpn.omr.secret)"
|
||||
if [ -n "$keyfile" ]; then
|
||||
|
@ -88,7 +88,7 @@ _set_openvpn_vps() {
|
|||
else
|
||||
key=""
|
||||
fi
|
||||
[ -z "$key" ] && return "OpenVPN key not set"
|
||||
[ -z "$key" ] && echo "OpenVPN key not set"
|
||||
local current_port current_key
|
||||
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
|
||||
[ -z "$vps_config" ] && return
|
||||
|
@ -97,7 +97,7 @@ _set_openvpn_vps() {
|
|||
if [ "$current_port" != "$port" ] || [ "$current_key" != "$key" ]; then
|
||||
local settings
|
||||
settings='{"port": '$port',"key":"'$key'"}'
|
||||
return $(_set_json "openvpn" "$settings")
|
||||
echo $(_set_json "openvpn" "$settings")
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ _get_ss_server() {
|
|||
_set_ss_server_vps() {
|
||||
local disabled port key method
|
||||
config_get disabled $1 disabled
|
||||
[ "$disabled" = "1" ] && return "Shadowsocks disabled"
|
||||
[ "$disabled" = "1" ] && echo "Shadowsocks disabled"
|
||||
config_get port $1 server_port
|
||||
#config_get server $1 server
|
||||
config_get key $1 key
|
||||
|
@ -153,7 +153,7 @@ _set_ss_server_vps() {
|
|||
if [ "$current_obfs_plugin" != "$obfs_plugin" ] || [ "$current_obfs_type" != "$obfs_type" ] || [ "$current_port" != "$port" ] || [ "$current_method" != "$method" ] || [ "$current_key" != "$key" ] || [ "$current_ebpf" != "$ebpf" ] || [ "$current_obfs" != "$obfs" ] || [ "$current_fast_open" != "$fast_open" ] || [ "$current_no_delay" != "$no_delay" ]; then
|
||||
local settings
|
||||
settings='{"port": '$port',"method":"'$method'","fast_open":'$fast_open',"reuse_port":true,"no_delay":'$no_delay',"mptcp":true,"key":"'$key'","ebpf":'$ebpf',"obfs":'$obfs',"obfs_plugin":"'$obfs_plugin'","obfs_type":"'$obfs_type'"}'
|
||||
return $(_set_json "shadowsocks" "$settings")
|
||||
echo $(_set_json "shadowsocks" "$settings")
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ _set_redirect_ports_from_vps() {
|
|||
[ "$redirect_ports" = "0" ] && redirect_ports_request="disable"
|
||||
[ "$redirect_ports_request" != "$redirect_ports_current" ] && {
|
||||
settings='{"redirect_ports": "'$redirect_ports_request'"}'
|
||||
return $(_set_json "shorewall" "$settings")
|
||||
echo $(_set_json "shorewall" "$settings")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ _set_mptcp_vps() {
|
|||
[ -z "$congestion" ] && congestion="bbr"
|
||||
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'"}'
|
||||
return $(_set_json "mptcp" "$settings")
|
||||
echo $(_set_json "mptcp" "$settings")
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ _set_vpn_vps() {
|
|||
vpn="$(uci -q get openmptcprouter.settings.vpn)"
|
||||
if [ "$vpn_current" != "$vpn" ]; then
|
||||
settings='{"vpn" : "'$vpn'"}'
|
||||
return $(_set_json "vpn" "$settings")
|
||||
echo $(_set_json "vpn" "$settings")
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue