Skip to content

Commit

Permalink
sync (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan168 authored Apr 3, 2024
2 parents 898b24d + bb3a102 commit 67db72c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ return L.view.extend({
o = s.option(form.ListValue, 'family', _('Restrict to address family'));
o.value('ipv4ipv6', _('IPv4 and IPv6'));
o.value('ipv4', _('IPv4 only'));
o.value('ipv4', _('IPv6 only'));
o.value('ipv6', _('IPv6 only'));
o.default = 'ipv4ipv6';
o.modalonly = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,7 @@ function settings_add()

-- Apply all settings
luci.sys.call("/etc/init.d/openmptcprouter restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/openmptcprouter-vps set_vps_firewall >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/omr-6in4 restart >/dev/null 2>/dev/null")

-- Done, redirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
fi
fi
if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ]; then
_log "Tunnel up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
_log "Tunnel up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE (was $default_gw)"
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Default gw : $default_gw - Current route: $(ip r)"
ip route replace default scope global via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE $initcwrwnd 2>&1 >/dev/null
if [ "$(pgrep -f openmptcprouter-vps)" = "" ]; then
Expand Down
2 changes: 1 addition & 1 deletion openmptcprouter-full/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ MY_DEPENDS := \
luci-theme-openwrt-2020 luci-proto-wireguard luci-app-wireguard kmod-crypto-lib-blake2s (TARGET_x86||TARGET_x86_64):kmod-r8125 \
!(LINUX_5_4):mptcpd (TARGET_x86||TARGET_x86_64):kmod-igc !TARGET_mvebu:kmod-mmc-spi kmod-macsec usbutils v2ray-core LINUX_5_4:v2ray-config !LINUX_5_4:v2ray-config-nft syslogd \
(TARGET_x86||TARGET_x86_64):kmod-mlx4-core \
!(TARGET_ips40xx||TARGET_ramips||KERNEL_6_6):iptables-mod-ndpi !(TARGET_ips40xx||TARGET_ramips||KERNEL_6_6):kmod-ipt-ndpi libip4tc libip6tc \
!(TARGET_ipq40xx||TARGET_ramips||KERNEL_6_6||TARGET_mvebu||TARGET_ipq806x||TARGET_mediatek):iptables-mod-ndpi !(TARGET_ipq40xx||TARGET_ramips||KERNEL_6_6||TARGET_mvebu||TARGET_ipq806x||TARGET_mediatek):kmod-ipt-ndpi libip4tc libip6tc \
xray-core LINUX_5_4:xray-config !LINUX_5_4:xray-config-nft (LINUX_5_4&&(TARGET_x86_64||aarch64)):kmod-tcp-bbr2 kmod-ovpn-dco-v2 \
shadowsocks-rust-sslocal shadowsocks-rust-ssservice LINUX_5_4:shadowsocks-rust-config !LINUX_5_4:shadowsocks-rust-config-nft luci-app-shadowsocks-rust \
luci-proto-external omr-schedule jq luci-app-ddns
Expand Down
10 changes: 10 additions & 0 deletions openmptcprouter/files/bin/omr-test-speed
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ else
ipset add ss_rules_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_4 2>/dev/null)" ]; then
for ip in $hostip; do
nft add element inet fw4 omr_dst_bypass_all_4 { $ip } 2>&1 >/dev/null
done
fi
if [ "$FASTTEST" = true ]; then
avg_speed=$(curl -4 --max-time 10 -o /dev/null -qfsS -w '%{speed_download}' --interface $INTERFACE $HOST 2>/dev/null)
echo "$avg_speed"
Expand All @@ -68,5 +73,10 @@ else
ipset del ss_rules_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_4 2>/dev/null)" ]; then
for ip in $hostip; do
nft delete element inet fw4 omr_dst_bypass_all_4 { $ip } 2>&1 >/dev/null
done
fi
/etc/init.d/sqm start $INTERFACE
fi
10 changes: 10 additions & 0 deletions openmptcprouter/files/bin/omr-test-speedv6
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ else
ipset add ss_rules6_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_6 2>/dev/null)" ]; then
for ip in $hostip; do
nft add element inet fw4 omr_dst_bypass_all_6 { $ip } 2>&1 >/dev/null
done
fi
if [ "$FASTTEST" = true ]; then
avg_speed=$(curl -6 --max-time 10 -o /dev/null -qfsS -w '%{speed_download}' --interface $INTERFACE $HOST 2>/dev/null)
echo "$avg_speed"
Expand All @@ -65,5 +70,10 @@ else
ipset del ss_rules6_dst_bypass_all $ip
done
fi
if [ -n "$(nft list set inet fw4 omr_dst_bypass_all_6 2>/dev/null)" ]; then
for ip in $hostip; do
nft delete element inet fw4 omr_dst_bypass_all_6 { $ip } 2>&1 >/dev/null
done
fi
/etc/init.d/sqm start $INTERFACE
fi

0 comments on commit 67db72c

Please sign in to comment.