let adbyby plus can autoupdate rules in dhcp client network environment for XueMao

This commit is contained in:
coolsnowwolf 2018-10-19 19:26:20 +08:00
parent 1c4bad1c05
commit 41821e23c7
3 changed files with 15 additions and 2 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:=32
PKG_RELEASE:=33
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -172,7 +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
fi
done
fi
rm -f /tmp/adbyby.mem
echo "add adbyby rules"
add_rules
$PROG_PATH/adbyby &>/dev/null &

View File

@ -21,4 +21,4 @@ fi
rm -f /tmp/lazy.txt /tmp/video.txt /tmp/user.action
/etc/init.d/adbyby restart
[ ! -f "/tmp/adbyby.mem" ] && /etc/init.d/adbyby restart