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

Add log on omr-tracker-ss

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-02-05 19:48:15 +01:00
parent f27860f81f
commit 44b1243356

View file

@ -72,7 +72,7 @@ while true; do
if [ "$(curl -s -I -w %{http_code} --socks5 ${proxy} --max-time ${timeout} $host -o /dev/null)" != "000" ]; then
nocontact=""
[ "${last}" -ge "${retry}" ] || [ "$(uci -q get openmptcprouter.omr.ss_${server})" = "" ] && {
_log "Shadowsocks is up (can contact via http ${host})"
_log "Shadowsocks ${server} is up (can contact via http ${host})"
uci -q set openmptcprouter.omr.ss_${server}="up"
uci -q commit openmptcprouter.omr
}
@ -87,8 +87,8 @@ while true; do
last=$((last + 1 ))
[ -z "$nocontact" ] && nocontact="$host" || nocontact="$nocontact, $host"
[ "${last}" -ge "${retry}" ] && {
if [ -n "$(iptables -t nat -L -n | grep ssr)" ]; then
_log "Shadowsocks is down (can't contact via http ${nocontact})"
if [ -n "$(iptables -w -t nat -L -n | grep ssr)" ]; then
_log "Shadowsocks ${server} is down (can't contact via http ${nocontact})"
uci -q set openmptcprouter.omr.ss_${server}="down"
uci -q commit openmptcprouter.omr
[ "$(uci show openmptcprouter.omr | grep ss | grep up)" = "" ] && /etc/init.d/shadowsocks-libev rules_down 2> /dev/null