From 1ef60c4d08cfa842faf7dfde54a5ea02fc3788c0 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 20 Oct 2018 02:47:28 +0800 Subject: [PATCH] speedup adbyby plus restart --- package/lean/luci-app-adbyby-plus/Makefile | 2 +- .../root/etc/init.d/adbyby | 24 ++++++++++--------- .../root/usr/share/adbyby/adupdate.sh | 2 ++ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/package/lean/luci-app-adbyby-plus/Makefile b/package/lean/luci-app-adbyby-plus/Makefile index c21b76dd2..223331d3e 100644 --- a/package/lean/luci-app-adbyby-plus/Makefile +++ b/package/lean/luci-app-adbyby-plus/Makefile @@ -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 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 7e4dfd739..cd10d1ff4 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 @@ -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" diff --git a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh index 63f75c36a..31466188c 100755 --- a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh +++ b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh @@ -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