1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
This commit is contained in:
suyuan 2024-08-21 10:23:27 +08:00 committed by GitHub
commit a9acbd4ae8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 26 additions and 20 deletions

View file

@ -35,6 +35,7 @@ return L.view.extend({
o = s.option(form.ListValue, 'multipath', _('Multipath TCP'));
o.value("enable", _("enable"));
o.value("disable", _("disable"));
o.readonly = true;
o = s.option(form.ListValue, "mptcp_checksum", _("Multipath TCP checksum"));
o.value(1, _("enable"));

View file

@ -186,9 +186,10 @@ multipath_fix() {
/etc/init.d/mptcp reload $interface >/dev/null 2>&1
}
}
config_load network
config_foreach multipath_fix interface
if [ "$(uci -q get network.globals.multipath)" = "enable" ]; then
config_load network
config_foreach multipath_fix interface
fi
if [ -f /etc/init.d/shadowsocks-libev ] && [ "$(uci -q get shadowsocks-libev.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-libev.sss0.key)" != "" ] && [ "$(uci -q get shadowsocks-libev.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-libev.sss0.server)" != "192.168.1.3" ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-ss for Shadowsocks libev, restart omr-tracker..."
/etc/init.d/omr-tracker restart >/dev/null 2>&1

View file

@ -428,8 +428,10 @@ start_service() {
config_load shadowsocks-rust
config_foreach _initialize_shadowsocks_rust_tracker server
config_load network
config_foreach _launch_tracker interface
if [ "$(uci -q get network.globals.multipath)" = "enable" ]; then
config_load network
config_foreach _launch_tracker interface
fi
if [ "$ss_enable" = "1" ]; then
config_load shadowsocks-libev
@ -469,7 +471,7 @@ start_service() {
}
service_triggers() {
procd_add_reload_trigger omr-tracker network shadowsocks-libev v2ray xray
procd_add_reload_trigger omr-tracker network
}
reload_service() {

View file

@ -722,7 +722,7 @@ dns_flush() {
# Get the current multipath status
multipath_status="off"
if [ -e "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
if [ -e "/sys/class/net/$OMR_TRACKER_DEVICE" ] && [ "$(uci -q get network.globals.multipath)" = "enable" ]; then
case "$(multipath "$OMR_TRACKER_DEVICE")" in
*default*) multipath_status="on" ;;
*backup*) multipath_status="backup" ;;
@ -1054,7 +1054,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && { [ "$multipath_config" = "on" ] || [ "$mu
fi
fi
if [ "$(sysctl -qen net.mptcp.mptcp_enabled | tr -d '\n')" = "1" ] || [ "$(sysctl -qen net.mptcp.enabled | tr -d '\n')" = "1" ]; then
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$(uci -q get network.globals.mptcp_force_multipath)" != "0" ] && {
[ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.multipathvpn)" != "1" ] && [ "$(uci -q get network.globals.mptcp_force_multipath)" != "0" ] && [ "$(uci -q get network.globals.multipath)" = "enable" ] && {
if [ "$multipath_status" = "$multipath_config" ] && ([ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv4)" != "$OMR_TRACKER_DEVICE_IP" ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.local_ipv6)" != "$OMR_TRACKER_DEVICE_IP6" ]); then
_log "Local IP changed for $OMR_TRACKER_DEVICE ($OMR_TRACKER_INTERFACE) force Multipath"
multipath "$OMR_TRACKER_DEVICE" "$multipath_config"

View file

@ -11,6 +11,10 @@ timeout 1 mmcli -L | while read MODEM; do
NUMBER=$(echo "$MODEM_INFO" | grep -m 1 'modem.generic.own-numbders.value[1]' | awk -F": " '{print $2}')
STATE=$(echo "$MODEM_INFO" | grep -m 1 'modem.generic.state ' | awk -F": " '{print $2}')
TYPE=$(echo "$MODEM_INFO" | grep -m 1 'modem.generic.access-technologies.value\[1\]' | awk -F": " '{print $2}')
if [ -n "$(grep -m 1 'modem.generic.access-technologies.value\[2\]')" ]; then
TYPE2=$(echo "$MODEM_INFO" | grep -m 1 'modem.generic.access-technologies.value\[2\]' | awk -F": " '{print $2}')
TYPE="$TYPE, $TYPE2"
fi
[ -z "$INFO" ] && echo $PERCENT
[ "$INFO" = "all" ] && echo "$PERCENT;$OPERATOR;$NUMBER;$STATE;$TYPE"
exit

View file

@ -313,26 +313,24 @@ _set_ssgo_server_vps() {
local current_port current_key current_method
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
[ -z "$vps_config" ] && return
current_port="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks-go.port')"
current_key="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks-go.key')"
current_method="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks-go.method')"
current_fast_open="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks-go.fast_open')"
current_mptcp="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks-go.mptcp')"
current_port="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks_go.config.port')"
current_key="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks_go.config.password')"
current_method="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks_go.config.protocol')"
# current_fast_open="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks_go.config.fast_open')"
# current_mptcp="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks_go.config.mptcp')"
ebpf="false"
fast_open="false"
no_delay="false"
mptcp="false"
obfs="false"
obfs_plugin="v2ray"
obfs_type="http"
config_load shadowsocks-rust
config_foreach _get_ss_redir ss_redir
config_foreach _get_ss_server server
# Force disable fast open for now du to problem on 6.1 with MPTCP
fast_open="false"
if [ "$current_mptcp" != "$mptcp" ] || [ "$current_port" != "$port" ] || [ "$current_method" != "$method" ] || [ "$current_fast_open" != "$fast_open" ]; then
#if [ "$current_mptcp" != "$mptcp" ] || [ "$current_port" != "$port" ] || [ "$current_method" != "$method" ] || [ "$current_fast_open" != "$fast_open" ]; then
if [ "$current_port" != "$port" ] || [ "$current_method" != "$method" ]; then
local settings
settings='{"port": '$port',"method":"'$method'","fast_open":'$fast_open',"reuse_port":false,"mptcp":'$mptcp'}'
result=$(_set_json "shadowsocks-go" "$settings")
@ -943,9 +941,9 @@ _set_lan_ip() {
local settings
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
[ -z "$vps_config" ] && return
#lanip_current="$(echo "$vps_config" | jsonfilter -q -e '@.lan.ips')"
#if [ "$lanips" != "" ] && [ "$lanip_current" != "$lanips" ]; then
if [ "$lanips" != "" ]; then
lanip_current="$(echo "$vps_config" | jsonfilter -q -e '@.lan.ips' | sed -e 's:\\::g' -e 's:\[::g' -e 's:\]::g')"
if [ "$lanips" != "" ] && [ "$lanip_current" != "$lanips" ]; then
#if [ "$lanips" != "" ]; then
settings='{"lanips" : ['$lanips']}'
result=$(_set_json "lan" "$settings")
fi