mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
Fix Shadowsocks status test
This commit is contained in:
parent
77a7644ad2
commit
7e851fc9b7
3 changed files with 14 additions and 17 deletions
|
@ -9,7 +9,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=omr-tracker
|
PKG_NAME:=omr-tracker
|
||||||
PKG_VERSION:=1.5
|
PKG_VERSION:=1.6
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
|
@ -19,7 +19,6 @@ nodns=0
|
||||||
last=0
|
last=0
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
while [ "$last" -gt 0 ]; do
|
|
||||||
host=${hosts%% *}
|
host=${hosts%% *}
|
||||||
if curl -s --socks5 "${proxy}" --max-time "${timeout}" "$host" &>/dev/null ; then
|
if curl -s --socks5 "${proxy}" --max-time "${timeout}" "$host" &>/dev/null ; then
|
||||||
[ "${last}" -gt 0 ] && log "Shadowsocks is up (can contact ${host})"
|
[ "${last}" -gt 0 ] && log "Shadowsocks is up (can contact ${host})"
|
||||||
|
@ -27,12 +26,10 @@ while true; do
|
||||||
last=0
|
last=0
|
||||||
else
|
else
|
||||||
last=$((last + 1 ))
|
last=$((last + 1 ))
|
||||||
[ "${last}" -ge "${retry}" ] && {
|
[ "${last}" -eq "${retry}" ] && {
|
||||||
log "Shadowsocks is down (can't contact ${host})"
|
log "Shadowsocks is down (can't contact ${host})"
|
||||||
/etc/init.d/shadowsocks-libev rules_down 2> /dev/null
|
/etc/init.d/shadowsocks-libev rules_down 2> /dev/null
|
||||||
last=0
|
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
sleep "${interval}"
|
sleep "${interval}"
|
||||||
done
|
done
|
||||||
|
|
|
@ -46,7 +46,7 @@ _launch_tracker() {
|
||||||
config_get multipath "$1" multipath
|
config_get multipath "$1" multipath
|
||||||
config_get gateway "$1" gateway
|
config_get gateway "$1" gateway
|
||||||
|
|
||||||
[ -z "$ifname" ] || [ -z "$multipath" ] || [ "$multipath" = "off" ] && [ "$1" != "glorytun" ] && return
|
[ -z "$ifname" ] || [ -z "$multipath" ] || [ "$multipath" = "off" ] && [ "$1" != "glorytun" ] && [ "$1" != "omrvpn" ] && return
|
||||||
[ "${enabled}" = "0" ] && return
|
[ "${enabled}" = "0" ] && return
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
|
|
Loading…
Reference in a new issue