1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge pull request #359 from Ysurac/develop

sync
This commit is contained in:
suyuan 2023-10-03 09:45:43 -05:00 committed by GitHub
commit a776f08193
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 4 deletions

View file

@ -12,6 +12,11 @@ if [ -f /etc/init.d/shadowsocks-libev ] && [ "$(pgrep -f omr-tracker-ss)" = "" ]
/etc/init.d/shadowsocks-libev restart 2>&1 >/dev/null
sleep 5
fi
if [ -f /etc/init.d/shadowsocks-rust ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f sslocal)" = "" ] && [ "$(pgrep -f sslocal)" = "" ] && [ "$(uci -q get shadowsocks-rust.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "192.18.1.3" ] && [ "$(uci -q get shadowsocks-rust.sss0.key)" != "" ]; then
_log "Can't find Shadowsocks Rust, restart it..."
/etc/init.d/shadowsocks-rust restart 2>&1 >/dev/null
sleep 5
fi
if [ -f /etc/init.d/glorytun ] && [ "$(pgrep glorytun)" = "" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ] && [ -f /etc/init.d/glorytun ] && [ "$(uci -q get glorytun.vpn.key)" != "" ]; then
_log "Can't find Glorytun, restart it..."
/etc/init.d/glorytun restart 2>&1 >/dev/null
@ -63,6 +68,11 @@ if [ "$(pgrep -f v2ray)" = "" ] && [ "$(uci -q get v2ray.main.enabled)" = "1" ]
/etc/init.d/v2ray restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep -f xray)" = "" ] && [ "$(uci -q get xray.main.enabled)" = "1" ] && [ -f /etc/init.d/xray ]; then
_log "Can't find XRay, restart it..."
/etc/init.d/xray restart 2>&1 >/dev/null
sleep 5
fi
if [ "$(pgrep miniupnpd)" = "" ] && [ "$(uci -q get upnpd.config.enabled)" = "1" ] && [ -f /etc/init.d/miniupnpd ]; then
_log "Can't find miniupnpd, restart it..."
/etc/init.d/miniupnpd restart 2>&1 >/dev/null
@ -95,13 +105,17 @@ if [ "$(uci -q get v2ray.main.enabled)" = "1" ] && [ -f /etc/init.d/v2ray ] && [
_log "Can't find omr-tracker-v2ray, restart omr-tracker..."
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
fi
if [ "$(uci -q get xray.main.enabled)" = "1" ] && [ -f /etc/init.d/xray ] && [ "$(pgrep -f omr-tracker-xray)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-xray, restart omr-tracker..."
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
fi
set_get_config() {
local server=$1
[ -n "$server" ] && uci -q set openmptcprouter.${server}.get_config=1
}
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.18.1.3" ]; then
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.18.1.3" ]) || ([ -f /etc/init.d/shadowsocks-rust ] && [ "$(uci -q get shadowsocks-rust.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.sss0.key)" = "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "192.18.1.3" ]); then
config_load openmptcprouter
config_foreach set_get_config server
[ -n "$(uci -q changes openmptcprouter)" ] && uci -q commit openmptcprouter
@ -112,6 +126,11 @@ if [ -f /etc/init.d/shadowsocks-libev ] && [ "$(uci -q get shadowsocks-libev.sss
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
fi
if [ -f /etc/init.d/shadowsocks-rust ] && [ "$(uci -q get shadowsocks-rust.sss0.disabled)" != "1" ] && [ "$(uci -q get shadowsocks-rust.sss0.key)" != "" ] && [ "$(uci -q get shadowsocks-rust.sss0.server)" != "" ] && [ "$(uci -q get shadowsocks-libev.rust.server)" != "192.18.1.3" ] && [ "$(pgrep -f omr-tracker-ss)" = "" ] && [ "$(pgrep -f '/etc/init.d/omr-tracker')" = "" ]; then
_log "Can't find omr-tracker-ss, restart omr-tracker..."
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
fi
if [ "$(uci -q get glorytun.vpn.enable)" = "1" ] && [ "$(uci -q get glorytun.vpn.key)" = "" ]; then
config_load openmptcprouter
config_foreach set_get_config server
@ -124,6 +143,12 @@ if [ "$(uci -q get v2ray.main.enabled)" = "1" ] && [ "$(uci -q get v2ray.omrout.
[ -n "$(uci -q changes openmptcprouter)" ] && uci -q commit openmptcprouter
fi
if [ "$(uci -q get xray.main.enabled)" = "1" ] && [ "$(uci -q get xray.omrout.s_vless_user_id)" = "" ]; then
config_load openmptcprouter
config_foreach set_get_config server
[ -n "$(uci -q changes openmptcprouter)" ] && uci -q commit openmptcprouter
fi
if [ -n "$(logread | tail -n 2 | grep 'Ring expansion failed')" ]; then
_log "Workaround Ring expansion failed problem"
echo 1 > /sys/bus/pci/devices/0000:00:00.0/remove

View file

@ -6,7 +6,7 @@
#
# This script set lights on RUTX device
if [ -n "$(grep RUTX /etc/board.json)" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
if [ -n "$(grep RUTX /etc/board.json)" ] && [ -z "$(grep RUTX50 /etc/board.json)" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
if [ "$OMR_TRACKER_DEVICE" = "wwan0" ]; then
modemdata=$(omr-modemmanager '/sys/devices/platform/soc/60f8800.usb2/6000000.dwc3/xhci-hcd.1.auto/usb3/3-1' all)
gen=$(echo $modemdata | cut -d ';' -f 5 | tr -d '\n')

View file

@ -351,7 +351,7 @@ uci -q delete network.loopback.ifname
uci -q set network.loopback.device='lo'
local board=$(board_name)
if [ "$board" = "teltonika,rutx" ] && [ -f /sbin/mnf_info ]; then
if ([ "$board" = "teltonika,rutx" ] || [ "$board" = "teltonika,rutx12" ] || [ "$board" = "teltonika,rutx50" ]) && [ -f /sbin/mnf_info ]; then
# Same part for RUTX12 and RUTX11, maybe other RUTX ?
uci -q batch <<-EOF
set network.modem1=interface
@ -388,6 +388,11 @@ if [ "$board" = "teltonika,rutx" ] && [ -f /sbin/mnf_info ]; then
commit firewall
EOF
fi
if [ "$(mnf_info -n)" = "RUTX5000XXXX" ]; then
uci -q batch <<-EOF
set network.modem1.device='/sys/devices/platform/soc/8af8800.usb3/8a00000.dwc3/xhci-hcd.0.auto/usb2/2-1'
EOF
fi
uci -q batch <<-EOF
set network.wifi24=interface
set network.wifi24.proto='none'

View file

@ -1375,7 +1375,7 @@ add_inbound_setting() {
json_add_boolean "tcpFastOpen" "$ss_sockopt_tcp_fast_open"
if version_over_5_4; then
test -n "$ss_sockopt_mptcp" && \
json_add_boolean "mptcp" "$ss_sockopt_mptcp"
json_add_boolean "tcpMptcp" "$ss_sockopt_mptcp"
fi
test -n "$ss_sockopt_tproxy" && \
json_add_string "tproxy" "$ss_sockopt_tproxy"

View file

@ -67,6 +67,7 @@ if [ -z "$(uci -q get xray.main)" ]; then
set xray.omrout.ss_tls_key_file='/etc/luci-uploads/client.key'
set xray.omrout.s_shadowsocks_port='65252'
set xray.omrout.mux_concurrency='8'
set xray.omrout.ss_sockopt_mptcp='1'
set xray.omr=inbound
set xray.omr.tag='omrtunnel'
set xray.omr.listen='0.0.0.0'
@ -199,4 +200,11 @@ if [ "$(uci -q get xray.omrout.s_socks_port)" = "" ]; then
EOF
fi
if [ "$(uci -q get xray.omrout.ss_sockopt_mptcp)" = "" ]; then
uci -q batch <<-EOF >/dev/null
set xray.omrout.ss_sockopt_mptcp='1'
commit xray
EOF
fi
exit 0