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

Fix shadowsocks rules status for multi rules

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-06-27 21:45:43 +02:00
parent 782a610e53
commit 5c5786210c
2 changed files with 3 additions and 3 deletions

View file

@ -65,7 +65,7 @@ while true; do
uci -q set openmptcprouter.omr.shadowsocks="up"
uci -q commit openmptcprouter.omr
}
if [ -z "$(iptables -t nat -L -n | grep ss_rules_forward)" ] && [ "$(uci -q get shadowsocks-libev.ss_rules.disabled)" != "1" ]; then
if [ -z "$(iptables -t nat -L -n | grep ss_rules)" ] && [ "$(uci -q get shadowsocks-libev.ss_rules.disabled)" != "1" ]; then
_log "Reload Shadowsocks rules"
/etc/init.d/shadowsocks-libev rules_up 2> /dev/null
_get_ip
@ -76,7 +76,7 @@ while true; do
last=$((last + 1 ))
[ -z "$nocontact" ] && nocontact="$host" || nocontact="$nocontact, $host"
[ "${last}" -ge "${retry}" ] && {
if [ -n "$(iptables -t nat -L -n | grep ss_rules_forward)" ]; then
if [ -n "$(iptables -t nat -L -n | grep ss_rules)" ]; then
_log "Shadowsocks is down (can't contact via http ${nocontact})"
uci -q set openmptcprouter.omr.shadowsocks="down"
uci -q commit openmptcprouter.omr

View file

@ -288,7 +288,7 @@ stop_service() {
}
rules_exist() {
[ -n "$(iptables -t nat -L -n | grep ss_rules_forward)" ] && return 0
[ -n "$(iptables -t nat -L -n | grep ss_rules)" ] && return 0
return 1
}