mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
Write all tests done for shadowsocks tracker in down message
This commit is contained in:
parent
58800cb6a7
commit
4498e5943a
1 changed files with 5 additions and 3 deletions
|
@ -19,12 +19,12 @@ timeout=${OMR_TRACKER_TIMEOUT:-5}
|
|||
interval=${OMR_TRACKER_INTERVAL:-10}
|
||||
retry=${OMR_TRACKER_TRIES:-4}
|
||||
proxy=${OMR_TRACKER_PROXY:-127.0.0.1:1111}
|
||||
hosts=${OMR_TRACKER_HOSTS:-1.1.1.1 1.0.0.1 23.96.52.53}
|
||||
hosts=${OMR_TRACKER_HOSTS:-1.1.1.1 1.0.0.1}
|
||||
|
||||
nodns=0
|
||||
|
||||
last=0
|
||||
|
||||
nocontact=""
|
||||
uci -q set openmptcprouter.vps.shadowsocks="up"
|
||||
get_ip
|
||||
|
||||
|
@ -34,6 +34,7 @@ while true; do
|
|||
hosts="${hosts#* } $host"
|
||||
}
|
||||
if curl -s --socks5 "${proxy}" --max-time "${timeout}" "$host" &>/dev/null ; then
|
||||
nocontact=""
|
||||
[ "${last}" -ge "${retry}" ] && {
|
||||
log "Shadowsocks is up (can contact ${host})"
|
||||
uci -q set openmptcprouter.vps.shadowsocks="up"
|
||||
|
@ -46,9 +47,10 @@ while true; do
|
|||
last=0
|
||||
else
|
||||
last=$((last + 1 ))
|
||||
[ -z "$nocontact" ] && nocontact="$host" || nocontact="$nocontact, $host"
|
||||
[ "${last}" -ge "${retry}" ] && {
|
||||
if /etc/init.d/shadowsocks-libev rules_exist ; then
|
||||
log "Shadowsocks is down (can't contact ${host})"
|
||||
log "Shadowsocks is down (can't contact ${nocontact})"
|
||||
uci -q set openmptcprouter.vps.shadowsocks="down"
|
||||
/etc/init.d/shadowsocks-libev rules_down 2> /dev/null
|
||||
get_ip
|
||||
|
|
Loading…
Reference in a new issue