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 LUCI_PKGARCH:=all
PKG_NAME:=luci-app-adbyby-plus PKG_NAME:=luci-app-adbyby-plus
PKG_VERSION:=2.0 PKG_VERSION:=2.0
PKG_RELEASE:=33 PKG_RELEASE:=35
include $(TOPDIR)/feeds/luci/luci.mk 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/ [ ! -d "/tmp/adbyby" ] && mkdir -p /tmp/adbyby && cp -a $PROG_PATH/data /tmp/adbyby/
mount --bind /tmp/adbyby/data $PROG_PATH/data mount --bind /tmp/adbyby/data $PROG_PATH/data
fi fi
touch /tmp/adbyby.mem if [ ! -f "/tmp/adbyby.updated" ];then
wget_ok="0" touch /tmp/adbyby.mem
while [ "$wget_ok" = "0" ] wget_ok="0"
do while [ "$wget_ok" = "0" ]
wget-ssl --spider --quiet --tries=1 --timeout=3 www.baidu.com do
if [ "$?" == "0" ]; then wget-ssl --spider --quiet --tries=1 --timeout=3 www.baidu.com
wget_ok="1" if [ "$?" == "0" ]; then
/usr/share/adbyby/adupdate.sh wget_ok="1"
else /usr/share/adbyby/adupdate.sh
sleep 10 else
sleep 10
fi
done
fi fi
done
fi fi
rm -f /tmp/adbyby.mem rm -f /tmp/adbyby.mem
echo "add adbyby rules" echo "add adbyby rules"

View File

@ -21,4 +21,6 @@ fi
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/user.action 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 [ ! -f "/tmp/adbyby.mem" ] && /etc/init.d/adbyby restart