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

auto sync (#376)

This commit is contained in:
suyuan 2023-11-07 10:18:26 +08:00 committed by GitHub
commit ca08cf30ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 15 deletions

View file

@ -121,6 +121,19 @@ if ([ -f /etc/init.d/shadowsocks-libev ] && [ "$(uci -q get shadowsocks-libev.ss
[ -n "$(uci -q changes openmptcprouter)" ] && uci -q commit openmptcprouter
fi
restart_omrtracker() {
[ -n "$(pgrep -f "omr-tracker $1)" ] && return
config_get multipath "$1" multipath
config_get ifenabled "$1" auto
[ -z "$multipath" ] || [ "$multipath" = "off" ] && return
[ "$ifenabled" = "0" ] && return
/etc/init.d/omr-tracker start_interface "$1"
sleep 10
}
config_load network
config_foreach restart_omrtracker interface
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" ] && [ "$(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

View file

@ -66,7 +66,7 @@ _check_master() {
set_ip() {
local ip=$1
ipresolve="$(resolveip -4 $ip | head -n 1)"
[ -z "$ipresolve" ] && ip="$ipresolve"
[ -n "$ipresolve" ] && ip="$ipresolve"
#_ping_server $ip
_check_server $ip $port
if [ "$server_ping" = true ]; then

View file

@ -9,6 +9,7 @@
START=90
STOP=10
USE_PROCD=1
EXTRA_COMMAND="start_interface"
}
. /usr/lib/unbound/iptools.sh
@ -331,9 +332,16 @@ _launch_xray_tracker() {
sleep 1
}
_dns_server() {
local ip=$1
resolv=$(resolveip -4 ${ip} | head -n 1)
[ -n "${resolv}" ] && [ "${resolv}" != "${ip}" ] && multiserver=true
}
_multi_server() {
config_get backup $1 backup
[ "$backup" = "1" ] && multiserver=true
config_list_foreach $1 ip _dns_server
}
_gre_tunnel() {
@ -341,6 +349,11 @@ _gre_tunnel() {
[ "$proto" = "gre" ] && gretunnel=true
}
start_interface() {
[ -z "$1" ] && return
_launch_tracker $1
}
start_service() {
local ss_enable=0
local ss_rust_enable=0

View file

@ -30,7 +30,6 @@ _openvpnbonding() {
set openvpn.omr_bonding_${interface}.remote="${remoteip}"
set openvpn.omr_bonding_${interface}.local="${localip}"
set openvpn.omr_bonding_${interface}.lport='0'
set openvpn.omr_bonding_${interface}.ncp_disable='1'
set openvpn.omr_bonding_${interface}.auth_nocache='1'
set openvpn.omr_bonding_${interface}.proto='udp'
set openvpn.omr_bonding_${interface}.client='1'

View file

@ -37,7 +37,6 @@ if [ "$(uci -q get openvpn.omr.proto)" != "tcp-client" ]; then
set openvpn.omr.port=65301
set openvpn.omr.cipher=AES-256-CBC
set openvpn.omr.proto=tcp-client
set openvpn.omr.ncp_disable=0
set openvpn.omr.auth_nocache=1
set openvpn.omr.client=1
set openvpn.omr.tls_client=1
@ -51,6 +50,7 @@ if [ "$(uci -q get openvpn.omr.proto)" != "tcp-client" ]; then
fi
uci -q delete openvpn.omr.secret
uci -q delete openvpn.omr.ncp_disable=0
#if [ "$(uci -q get openvpn.omr.com_lzo)" = "" ]; then
# uci -q batch <<-EOF >/dev/null

View file

@ -279,17 +279,6 @@ config openvpn sample_server
# Use BF-CBC as fallback
# option data_ciphers_fallback 'BF-CBC'
# OpenVPN versions 2.4 and later will attempt to
# automatically negotiate the most secure cipher
# between the client and server, regardless of a
# configured "option cipher" (see below).
# Automatic negotiation is recommended.
#
# Uncomment this option to disable this behavior,
# and force all OpenVPN peers to use the configured
# cipher option instead (not recommended).
# option ncp_disable
# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.

View file

@ -166,7 +166,6 @@ mlock
mtu_test
multihome
mute_replay_warnings
ncp_disable
nobind
opt_verify
passtos