1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00
This commit is contained in:
suyuan 2023-12-13 23:52:15 +08:00 committed by GitHub
commit edbd94e8bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 113 additions and 18 deletions

View file

@ -13,9 +13,10 @@ if [ "$1" = "fasttest" ]; then
fi
for i in $@; do :; done
INTERFACE="$i"
[ "$INTERFACE" = "forcevps" ] || [ "$INTERFACE" = "fasttest" ] && INTERFACE=""
[ -n "$INTERFACE" ] && [ ! -d "/sys/class/net/$INTERFACE" ] && {
echo "You must use a real interface. You wan find them using 'ip a' for example"
echo "You must use a real interface. You wan find them using 'ip a' for example (not $INTERFACE)"
exit 0
}
@ -41,7 +42,12 @@ done
[ "$FASTTEST" = true ] || echo "Best server is $HOST, running test:"
trap : HUP INT TERM
if [ -z "$INTERFACE" ]; then
curl -4 -o /dev/null $HOST || echo
if [ "$FASTTEST" = true ]; then
avg_speed=$(curl -4 --max-time 10 -o /dev/null -qfsS -w '%{speed_download}' $HOST 2>/dev/null)
echo "$avg_speed"
else
curl -4 -o /dev/null $HOST || echo
fi
else
[ -n "$(tc qdisc show dev $INTERFACE | grep ingress)" ] && /etc/init.d/sqm stop $INTERFACE
domain=$(echo $HOST | awk -F/ '{print $3}')

View file

@ -1,5 +1,4 @@
#!/bin/sh
#!/bin/sh
# (c) Yannick Chabanois (ycarus@zugaina.org) for OpenMPTCProuter
#
#
@ -14,6 +13,7 @@ if [ "$1" = "fasttest" ]; then
fi
for i in $@; do :; done
INTERFACE="$i"
[ "$INTERFACE" = "forcevps" ] || [ "$INTERFACE" = "fasttest" ] && INTERFACE=""
[ -n "$INTERFACE" ] && [ ! -d "/sys/class/net/$INTERFACE" ] && {
echo "You must use a real interface. You wan find them using 'ip a' for example"

View file

@ -353,6 +353,7 @@ _set_xray_server_vps() {
enabled=$(uci -q get xray.main.enabled)
userid=$(uci -q get xray.omrout.s_vless_user_id)
protocol=$(uci -q get xray.omrout.protocol)
ss_method=$(uci -q get xray.omrout.s_shadowsocks_method)
if [ "$protocol" = "vless-reality" ] && [ "$enabled" = "1" ]; then
vless_reality='true'
else
@ -363,10 +364,11 @@ _set_xray_server_vps() {
[ -z "$vps_config" ] && return
current_userid="$(echo "$vps_config" | jsonfilter -q -e '@.xray.config.key')"
current_vlessreality="$(echo "$vps_config" | jsonfilter -q -e '@.xray.config.vless_reality')"
current_method="$(echo "$vps_config" | jsonfilter -q -e '@.xray.config.ss_method')"
if [ "$current_userid" != "$userid" ] || [ "$current_vlessreality" != "$vless_reality" ]; then
if [ "$current_userid" != "$userid" ] || [ "$current_vlessreality" != "$vless_reality" ] || [ "$current_method" != "$ss_method" ]; then
local settings
settings='{"userid": "'$userid'","vless_reality": '$vless_reality'}'
settings='{"userid": "'$userid'","vless_reality": '$vless_reality',"ss_method": "'$ss_method'"}'
echo $(_set_json "xray" "$settings")
fi
}

View file

@ -45,9 +45,18 @@ if [ "$(uci -q get openvpn.omr.proto)" != "tcp-client" ]; then
set openvpn.omr.sndbuf=0
set openvpn.omr.rcvbuf=0
set openvpn.omr.route_delay=5
set openvpn.omr.disable_dco=1
commit openvpn
EOF
fi
if [ -z "$(uci -q get openvpn.omr.disable_dco)" ]; then
uci -q batch <<-EOF >/dev/null
set openvpn.omr.disable_dco=1
commit openvpn
EOF
fi
uci -q delete openvpn.omr.secret
uci -q delete openvpn.omr.ncp_disable=0