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

Merge branch 'test' into develop

This commit is contained in:
suyuan168 2022-06-03 16:10:54 +08:00
commit 5dfc97b574
8 changed files with 38 additions and 17 deletions

View file

@ -153,7 +153,7 @@ _ping() {
"${host}" 2>&1
) && echo "$ret" | grep -sq "bytes from" && {
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
_update_rto "$OMR_TRACKER_LATENCY"
fi
return
@ -166,7 +166,7 @@ _ping() {
"${host}" 2>&1
) && echo "$ret" | grep -sq "bytes from" && {
if [ "$localip" = "yes" ]; then
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1)
OMR_TRACKER_LATENCY=$(echo "$ret" | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n')
_update_rto "$OMR_TRACKER_LATENCY"
fi
return

View file

@ -82,6 +82,8 @@ _check_master() {
commit v2ray
set glorytun.vpn.host=$ip
commit glorytun
glorytun-udp.vpn.host=$ip
commit glorytun
set dsvpn.vpn.host=$ip
commit dsvpn
set mlvpn.general.host=$ip
@ -98,16 +100,20 @@ _check_master() {
/etc/init.d/openvpn restart >/dev/null 2>/dev/null
/etc/init.d/dsvpn restart >/dev/null 2>/dev/null
fi
else
logger -t "OMR-Tracker-Server" "Master server already up"
fi
config_load shadowsocks-libev
config_foreach _enable_redir ss_redir
count=$((count+1))
else
logger -t "OMR-Tracker-Server" "Master server down"
config_load shadowsocks-libev
config_foreach _disable_redir ss_redir
fi
countips=$((countips+1))
}
config_load openmptcprouter
config_list_foreach $1 ip set_ip
#if [ "$server_ping" = true ] && [ "$countips" = "1" ]; then
# uci -q batch <<-EOF >/dev/null
@ -149,6 +155,8 @@ _check_backup() {
commit v2ray
set glorytun.vpn.host=$ip
commit glorytun
glorytun-udp.vpn.host=$ip
commit glorytun
set dsvpn.vpn.host=$ip
commit dsvpn
set mlvpn.general.host=$ip
@ -176,6 +184,7 @@ _check_backup() {
fi
countips=$((countips+1))
}
config_load openmptcprouter
config_list_foreach $1 ip set_ip
#if [ "$server_ping" = true ] && [ "$countips" = "1" ]; then
# uci -q batch <<-EOF >/dev/null
@ -202,6 +211,7 @@ while true; do
config_load openmptcprouter
config_foreach _check_master server
[ "$server_ping" = false ] && {
config_load openmptcprouter
config_foreach _check_backup server
}
sleep "${interval}"