mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
auto sync (#376)
This commit is contained in:
commit
ca08cf30ef
7 changed files with 28 additions and 15 deletions
|
@ -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
|
[ -n "$(uci -q changes openmptcprouter)" ] && uci -q commit openmptcprouter
|
||||||
fi
|
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
|
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..."
|
_log "Can't find omr-tracker-ss, restart omr-tracker..."
|
||||||
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
|
/etc/init.d/omr-tracker restart 2>&1 >/dev/null
|
||||||
|
|
|
@ -66,7 +66,7 @@ _check_master() {
|
||||||
set_ip() {
|
set_ip() {
|
||||||
local ip=$1
|
local ip=$1
|
||||||
ipresolve="$(resolveip -4 $ip | head -n 1)"
|
ipresolve="$(resolveip -4 $ip | head -n 1)"
|
||||||
[ -z "$ipresolve" ] && ip="$ipresolve"
|
[ -n "$ipresolve" ] && ip="$ipresolve"
|
||||||
#_ping_server $ip
|
#_ping_server $ip
|
||||||
_check_server $ip $port
|
_check_server $ip $port
|
||||||
if [ "$server_ping" = true ]; then
|
if [ "$server_ping" = true ]; then
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
START=90
|
START=90
|
||||||
STOP=10
|
STOP=10
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
|
EXTRA_COMMAND="start_interface"
|
||||||
}
|
}
|
||||||
|
|
||||||
. /usr/lib/unbound/iptools.sh
|
. /usr/lib/unbound/iptools.sh
|
||||||
|
@ -331,9 +332,16 @@ _launch_xray_tracker() {
|
||||||
sleep 1
|
sleep 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_dns_server() {
|
||||||
|
local ip=$1
|
||||||
|
resolv=$(resolveip -4 ${ip} | head -n 1)
|
||||||
|
[ -n "${resolv}" ] && [ "${resolv}" != "${ip}" ] && multiserver=true
|
||||||
|
}
|
||||||
|
|
||||||
_multi_server() {
|
_multi_server() {
|
||||||
config_get backup $1 backup
|
config_get backup $1 backup
|
||||||
[ "$backup" = "1" ] && multiserver=true
|
[ "$backup" = "1" ] && multiserver=true
|
||||||
|
config_list_foreach $1 ip _dns_server
|
||||||
}
|
}
|
||||||
|
|
||||||
_gre_tunnel() {
|
_gre_tunnel() {
|
||||||
|
@ -341,6 +349,11 @@ _gre_tunnel() {
|
||||||
[ "$proto" = "gre" ] && gretunnel=true
|
[ "$proto" = "gre" ] && gretunnel=true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_interface() {
|
||||||
|
[ -z "$1" ] && return
|
||||||
|
_launch_tracker $1
|
||||||
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
local ss_enable=0
|
local ss_enable=0
|
||||||
local ss_rust_enable=0
|
local ss_rust_enable=0
|
||||||
|
|
|
@ -30,7 +30,6 @@ _openvpnbonding() {
|
||||||
set openvpn.omr_bonding_${interface}.remote="${remoteip}"
|
set openvpn.omr_bonding_${interface}.remote="${remoteip}"
|
||||||
set openvpn.omr_bonding_${interface}.local="${localip}"
|
set openvpn.omr_bonding_${interface}.local="${localip}"
|
||||||
set openvpn.omr_bonding_${interface}.lport='0'
|
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}.auth_nocache='1'
|
||||||
set openvpn.omr_bonding_${interface}.proto='udp'
|
set openvpn.omr_bonding_${interface}.proto='udp'
|
||||||
set openvpn.omr_bonding_${interface}.client='1'
|
set openvpn.omr_bonding_${interface}.client='1'
|
||||||
|
|
|
@ -37,7 +37,6 @@ if [ "$(uci -q get openvpn.omr.proto)" != "tcp-client" ]; then
|
||||||
set openvpn.omr.port=65301
|
set openvpn.omr.port=65301
|
||||||
set openvpn.omr.cipher=AES-256-CBC
|
set openvpn.omr.cipher=AES-256-CBC
|
||||||
set openvpn.omr.proto=tcp-client
|
set openvpn.omr.proto=tcp-client
|
||||||
set openvpn.omr.ncp_disable=0
|
|
||||||
set openvpn.omr.auth_nocache=1
|
set openvpn.omr.auth_nocache=1
|
||||||
set openvpn.omr.client=1
|
set openvpn.omr.client=1
|
||||||
set openvpn.omr.tls_client=1
|
set openvpn.omr.tls_client=1
|
||||||
|
@ -51,6 +50,7 @@ if [ "$(uci -q get openvpn.omr.proto)" != "tcp-client" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
uci -q delete openvpn.omr.secret
|
uci -q delete openvpn.omr.secret
|
||||||
|
uci -q delete openvpn.omr.ncp_disable=0
|
||||||
|
|
||||||
#if [ "$(uci -q get openvpn.omr.com_lzo)" = "" ]; then
|
#if [ "$(uci -q get openvpn.omr.com_lzo)" = "" ]; then
|
||||||
# uci -q batch <<-EOF >/dev/null
|
# uci -q batch <<-EOF >/dev/null
|
||||||
|
|
|
@ -279,17 +279,6 @@ config openvpn sample_server
|
||||||
# Use BF-CBC as fallback
|
# Use BF-CBC as fallback
|
||||||
# option data_ciphers_fallback 'BF-CBC'
|
# 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.
|
# Enable compression on the VPN link.
|
||||||
# If you enable it here, you must also
|
# If you enable it here, you must also
|
||||||
# enable it in the client config file.
|
# enable it in the client config file.
|
||||||
|
|
|
@ -166,7 +166,6 @@ mlock
|
||||||
mtu_test
|
mtu_test
|
||||||
multihome
|
multihome
|
||||||
mute_replay_warnings
|
mute_replay_warnings
|
||||||
ncp_disable
|
|
||||||
nobind
|
nobind
|
||||||
opt_verify
|
opt_verify
|
||||||
passtos
|
passtos
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue