diff --git a/package/lean/luci-app-adbyby-plus/root/etc/init.d/adbyby b/package/lean/luci-app-adbyby-plus/root/etc/init.d/adbyby index 804051363..d8b532f9a 100755 --- a/package/lean/luci-app-adbyby-plus/root/etc/init.d/adbyby +++ b/package/lean/luci-app-adbyby-plus/root/etc/init.d/adbyby @@ -65,8 +65,10 @@ ip_rule() ipset -N adbyby_esc hash:ip $ipt_n -A ADBYBY -m set --match-set adbyby_esc dst -j RETURN - - for i in $(seq 0 100) + + local icount=$(uci show unblockmusic | grep 'filter_mode' | wc -l) + let icount=icount-1 + for i in $(seq 0 $icount) do local ip=$(uci_get_by_type acl_rule ipaddr '' $i) local mode=$(uci_get_by_type acl_rule filter_mode '' $i) @@ -225,6 +227,3 @@ boot() mkdir -p /tmp/adbyby && cp -a /usr/share/adbyby /tmp/ start } - - - diff --git a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblock.sh b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblock.sh index 09832b556..23e59ffbf 100755 --- a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblock.sh +++ b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblock.sh @@ -5,4 +5,6 @@ if [ -s "/tmp/adnew.conf" ];then /usr/share/adbyby/ad-update fi -rm -f /tmp/adbyby.updated && /etc/init.d/adbyby restart +rm -f /tmp/adbyby.updated +sleep 10 +/etc/init.d/adbyby restart diff --git a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adbybyupdate.sh b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adbybyupdate.sh index 0ff22a6ea..1011f74a6 100755 --- a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adbybyupdate.sh +++ b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adbybyupdate.sh @@ -15,7 +15,7 @@ if [ ! -f "/tmp/adbyby.updated" ];then echo "Rules MD5 are the same!" echo $(date "+%Y-%m-%d %H:%M:%S") > /tmp/adbyby.updated exit 0 - else + elif [ -s /tmp/md5.json ];then touch /tmp/lazy.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/lazy.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/lazy.txt touch /tmp/video.txt && wget-ssl --no-check-certificate -t 1 -T 10 -O /tmp/video.txt https://adbyby.coding.net/p/xwhyc-rules/d/xwhyc-rules/git/raw/master/video.txt @@ -43,6 +43,6 @@ if [ ! -f "/tmp/adbyby.updated" ];then rm -f /tmp/adbyby/data/*.bak - kill -9 $(busybox ps -w | grep "adbyby --no-daemon" | grep -v grep | awk '{print $1}') >/dev/null 2>&1 + kill -9 $(busybox ps -w | grep 'adbyby --no-daemon' | grep -v grep | awk '{print $1}') >/dev/null 2>&1 fi