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-30 23:42:28 +08:00 committed by GitHub
commit 0c79279946
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 48 additions and 14 deletions

View file

@ -242,7 +242,7 @@ if [ "$(pgrep -f openmptcprouter-vps)" = "" ] && [ "$(uci -q show openmptcproute
/etc/init.d/openmptcprouter-vps token >/dev/null 2>&1 &
sleep 5
fi
if [ "$(pgrep -f openmptcprouter-vps)" = "" ] && ([ -z "$(uci -q show openmptcprouter | grep get_config)" ] || [ "$(uci -q show openmptcprouter | grep get_config=\'1\')" != "" ] || [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" != "" ]); then
if [ "$(pgrep -f openmptcprouter-vps)" = "" ] && ([ -z "$(uci -q show openmptcprouter | grep get_config)" ] || [ -n "$(uci -q show openmptcprouter | grep get_config=\'1\')" ] || [ -n "$(uci -q show openmptcprouter | grep admin_error=\'1\')" ]); then
/etc/init.d/openmptcprouter-vps restart >/dev/null 2>&1 &
sleep 5
fi
@ -256,7 +256,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && [ "$(uci -q get sqm.${OMR_TRACKER_INTERFAC
fi
#if [ "$(uci -q show openmptcprouter | grep server)" != "" ] && [ "$(uci -q show openmptcprouter | grep password)" != "" ] && [ "$(pgrep -f openmptcprouter-vps)" = "" ] && [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" = "" ] && ([ "$(uci -q show openmptcprouter | grep set_firewall=\'1\')" != "" ] || (([ -e /usr/sbin/iptables-nft-save ] && [ -z "$(iptables-save 2>/dev/null | grep omr_dst_bypass_${OMR_TRACKER_DEVICE})" ]) || [ -z "$(iptables-save 2>/dev/null | grep omr_dst_bypass_${OMR_TRACKER_DEVICE})" ])); then
if [ "$(pgrep -f set_vps_firewall)" = "" ] && [ "$(uci -q show openmptcprouter | grep server)" != "" ] && [ "$(uci -q show openmptcprouter | grep password)" != "" ] && [ "$(pgrep -f openmptcprouter-vps)" = "" ] && [ "$(uci -q show openmptcprouter | grep admin_error=\'1\')" = "" ] && [ "$(uci -q show openmptcprouter | grep set_firewall=\'1\')" != "" ]; then
if [ "$(pgrep -f set_vps_firewall)" = "" ] && [ "$(uci -q show openmptcprouter | grep server)" != "" ] && [ "$(uci -q show openmptcprouter | grep password)" != "" ] && [ "$(pgrep -f openmptcprouter-vps)" = "" ] && [ -z "$(uci -q show openmptcprouter | grep admin_error=\'1\')" ] && [ -n "$(uci -q show openmptcprouter | grep set_firewall=\'1\')" ]; then
check_server_fw() {
[ "$(uci -q get openmptcprouter.$1.set_firewall)" = "1" ] && {
_log "Set firewall on server $1"

View file

@ -26,6 +26,8 @@ export OMR_TRACKER_PREV_STATUS
export OMR_TRACKER_DEVICE
export OMR_TRACKER_DEVICE_IP
export OMR_TRACKER_DEVICE_IP6
export OMR_TRACKER_PREV_DEVICE_IP
export OMR_TRACKER_PREV_DEVICE_IP6
export OMR_TRACKER_DEVICE_GATEWAY
export OMR_TRACKER_DEVICE_GATEWAY6
export OMR_TRACKER_IPV6
@ -275,9 +277,9 @@ while true; do
OMR_TRACKER_DEVICE_GATEWAY=
OMR_TRACKER_DEVICE_GATEWAY6=
serverip_ping=false
[ -z "$OMR_TRACKER_DEVICE" ] && {
network_get_device OMR_TRACKER_DEVICE "$OMR_TRACKER_INTERFACE"
[ -z "$OMR_TRACKER_DEVICE" ] && network_get_physdev OMR_TRACKER_DEVICE "$OMR_TRACKER_INTERFACE"
[ -z "$OMR_TRACKER_DEVICE" ] || [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ] && {
network_get_physdev OMR_TRACKER_DEVICE "$OMR_TRACKER_INTERFACE"
[ -z "$OMR_TRACKER_DEVICE" ] && network_get_device OMR_TRACKER_DEVICE "$OMR_TRACKER_INTERFACE"
[ -z "$OMR_TRACKER_DEVICE" ] && OMR_TRACKER_DEVICE=$(ifstatus "$OMR_TRACKER_INTERFACE" | jsonfilter -q -e '@["l3_device"]')
[ -z "$OMR_TRACKER_DEVICE" ] && OMR_TRACKER_DEVICE=$(ifstatus "${OMR_TRACKER_INTERFACE}_4" | jsonfilter -q -e '@["l3_device"]')
#[ -z "$OMR_TRACKER_DEVICE" ] && config_get OMR_TRACKER_DEVICE "$OMR_TRACKER_INTERFACE" device
@ -286,7 +288,7 @@ while true; do
if [ -n "$OMR_TRACKER_DEVICE" ] && [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
#if [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep 'state UP')" ] || [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep 'state UNKNOWN')" ]; then
if [ "$(ifstatus $OMR_TRACKER_INTERFACE | jsonfilter -e '@.up')" == "true" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then
if [ "$(ifstatus $OMR_TRACKER_INTERFACE | jsonfilter -q -e '@.up')" == "true" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then
# retrieve iface ip and gateway
if { [ "$OMR_TRACKER_FAMILY" = "ipv4" ] || [ "$OMR_TRACKER_FAMILY" = "ipv4ipv6" ]; } && [ "$OMR_TRACKER_INTERFACE_PROTO" != "dhcpv6" ]; then
OMR_TRACKER_DEVICE_IP=$(ip -4 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}')
@ -623,6 +625,8 @@ while true; do
_post_tracking
[ "$OMR_TRACKER_STATUS" = "ERROR" ] && sleep $wait_test
OMR_TRACKER_PREV_STATUS="$OMR_TRACKER_STATUS"
OMR_TRACKER_PREV_DEVICE_IP="$OMR_TRACKER_DEVICE_IP"
OMR_TRACKER_PREV_DEVICE_IP6="$OMR_TRACKER_DEVICE_IP6"
_restart
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then

View file

@ -1,4 +1,11 @@
#!/bin/sh
#
# Copyright (C) 2018-2024 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# This script check if MPTCP status is correct on interface
# Set default multipath status
[ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && multipath "$OMR_TRACKER_DEVICE" off >/dev/null 2>&1

View file

@ -1,6 +1,12 @@
#!/bin/sh
#
# Copyright (C) 2018-2024 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# This script do commands when an interface is detected as down
. /lib/functions/network.sh
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
@ -114,6 +120,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || { [ "$OMR_TRACKER_INTERFACE" != "omrvp
if [ "$OMR_TRACKER_PREV_STATUS" = "$OMR_TRACKER_STATUS" ]; then
exit 0
fi
. /lib/functions/network.sh
# Get the current multipath status
multipath_status="off"
@ -293,3 +300,4 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || { [ "$OMR_TRACKER_INTERFACE" != "omrvp
exit 0
fi
exit 0

View file

@ -1,9 +1,20 @@
#!/bin/bash
#!/bin/sh
#
# Copyright (C) 2018-2024 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# This script do commands when an interface is detected as up
if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
exit 0
fi
if [ "$OMR_TRACKER_PREV_STATUS" = "$OMR_TRACKER_STATUS" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && [ "$OMR_TRACKER_PREV_DEVICE_IP" = "$OMR_TRACKER_DEVICE_IP" ] && [ "$OMR_TRACKER_PREV_DEVICE_IP6" = "$OMR_TRACKER_DEVICE_IP6" ]; then
exit 0
fi
SETROUTE=false
. /lib/functions/network.sh
@ -196,7 +207,7 @@ set_routes_intf() {
local interface_if
local INTERFACE=$1
[ -z "$INTERFACE" ] && return
[ "$INTERFACE" = "omrvpn" ] && continue
[ "$INTERFACE" = "omrvpn" ] && return
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
@ -255,8 +266,8 @@ set_routes_intf6() {
local interface_if
local INTERFACE=$1
[ -z "$INTERFACE" ] && return
[ "$INTERFACE" = "omr6in4" ] && continue
[ "$INTERFACE" = "omrvpn" ] && continue
[ "$INTERFACE" = "omr6in4" ] && return
[ "$INTERFACE" = "omrvpn" ] && return
multipath_config_route=$(uci -q get openmptcprouter.$INTERFACE.multipath)
[ -z "$multipath_config_route" ] && multipath_config_route=$(uci -q get network.$INTERFACE.multipath || echo "off")
[ "$(uci -q get openmptcprouter.$INTERFACE.multipathvpn)" = "1" ] && {
@ -1073,3 +1084,4 @@ fi
[ -n "$(uci -q changes openmptcprouter)" ] && uci -q commit openmptcprouter
#ubus call network reload
exit 0

View file

@ -275,6 +275,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && { [ "$(uci -q get openmptcprouter.$OMR_TRA
_log "Check API configuration... Done"
fi
fi
dns_flush
#dns_flush
fi
exit 0

View file

@ -61,3 +61,4 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ]; then
fi
fi
exit 0

View file

@ -64,3 +64,4 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ "$(pgrep
sleep 5
fi
exit 0

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xray
PKG_VERSION:=1.8.23
PKG_VERSION:=1.8.24
PKG_RELEASE:=1
PKG_LICENSE:=MPLv2
@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Yannick Chabanois <contact@openmptcprouter.com>
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/XTLS/Xray-core.git
PKG_SOURCE_VERSION:=4c82ef8a1b79a609efd3f7ba947896b6f8a2917c
PKG_SOURCE_VERSION:=6baad79f9881ee2cf75bdc825b3e2e92b289477a
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1