speedup adbyby plus restart

This commit is contained in:
coolsnowwolf 2018-10-20 02:47:28 +08:00
parent 3ac15bbed8
commit 1ef60c4d08
3 changed files with 16 additions and 12 deletions

View File

@ -10,7 +10,7 @@ LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-adbyby-plus
PKG_VERSION:=2.0
PKG_RELEASE:=33
PKG_RELEASE:=35
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -172,18 +172,20 @@ start()
[ ! -d "/tmp/adbyby" ] && mkdir -p /tmp/adbyby && cp -a $PROG_PATH/data /tmp/adbyby/
mount --bind /tmp/adbyby/data $PROG_PATH/data
fi
touch /tmp/adbyby.mem
wget_ok="0"
while [ "$wget_ok" = "0" ]
do
wget-ssl --spider --quiet --tries=1 --timeout=3 www.baidu.com
if [ "$?" == "0" ]; then
wget_ok="1"
/usr/share/adbyby/adupdate.sh
else
sleep 10
if [ ! -f "/tmp/adbyby.updated" ];then
touch /tmp/adbyby.mem
wget_ok="0"
while [ "$wget_ok" = "0" ]
do
wget-ssl --spider --quiet --tries=1 --timeout=3 www.baidu.com
if [ "$?" == "0" ]; then
wget_ok="1"
/usr/share/adbyby/adupdate.sh
else
sleep 10
fi
done
fi
done
fi
rm -f /tmp/adbyby.mem
echo "add adbyby rules"

View File

@ -21,4 +21,6 @@ fi
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/user.action
echo $(date) > /tmp/adbyby.updated
[ ! -f "/tmp/adbyby.mem" ] && /etc/init.d/adbyby restart