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

Disable omr-tracker if no hosts defined

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-01-07 18:05:00 +01:00
parent 200d7101a5
commit 244b8f421c
2 changed files with 4 additions and 3 deletions

View file

@ -59,7 +59,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.shadowsocks)" = "" ] && {
_log "Shadowsocks is up (can contact ${host})"
_log "Shadowsocks is up (can contact via http ${host})"
uci -q set openmptcprouter.omr.shadowsocks="up"
uci -q commit openmptcprouter.omr
}
@ -75,7 +75,7 @@ while true; do
[ -z "$nocontact" ] && nocontact="$host" || nocontact="$nocontact, $host"
[ "${last}" -ge "${retry}" ] && {
if [ -n "$(iptables -t nat -L -n | grep ss_rules_forward)" ]; then
_log "Shadowsocks is down (can't contact ${nocontact})"
_log "Shadowsocks is down (can't contact via http ${nocontact})"
uci -q set openmptcprouter.omr.shadowsocks="down"
uci -q commit openmptcprouter.omr
/etc/init.d/shadowsocks-libev rules_down 2> /dev/null