luci-app-adbyby-plus: avoid download loop from update server

This commit is contained in:
lean 2020-03-14 23:16:38 +08:00 committed by CN_SZTL
parent 60999b0cff
commit a074069eb8
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 9 additions and 8 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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