luci-app-adbyby-plus: rules always copy to ram

This commit is contained in:
lean 2020-03-13 19:20:14 +08:00
parent 8ecd6c8b3c
commit 49782de780
3 changed files with 12 additions and 8 deletions

View File

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

View File

@ -48,7 +48,7 @@ luci.sys.exec("/usr/share/adbyby/rule-update")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/* && cp -a /tmp/rules /usr/share/adbyby/")
luci.sys.exec("/etc/init.d/dnsmasq reload")
luci.sys.exec("/etc/init.d/adbyby restart &")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"
@ -68,7 +68,7 @@ if sret== 0 then
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /usr/share/adbyby/dnsmasq.adblock")
luci.sys.exec("cp -f /tmp/ad.conf /tmp/etc/dnsmasq-adbyby.d/adblock")
luci.sys.exec("/etc/init.d/dnsmasq reload")
luci.sys.exec("/etc/init.d/adbyby restart &")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"

View File

@ -109,11 +109,8 @@ add_dns()
awk '!/^$/&&!/^#/{printf("ipset=/%s/'"adbyby_esc"'\n",$0)}' $PROG_PATH/adesc.conf > /var/etc/dnsmasq-adbyby.d/06-dnsmasq.esc
awk '!/^$/&&!/^#/{printf("address=/%s/'"0.0.0.0"'\n",$0)}' $PROG_PATH/adblack.conf > /var/etc/dnsmasq-adbyby.d/07-dnsmasq.black
cat > /tmp/dnsmasq.d/dnsmasq-adbyby.conf <<EOF
conf-dir=/var/etc/dnsmasq-adbyby.d
addn-hosts=/usr/share/adbyby/rules/host/
conf-dir=/usr/share/adbyby/rules/data
EOF
echo 'conf-dir=/var/etc/dnsmasq-adbyby.d' > /tmp/dnsmasq.d/dnsmasq-adbyby.conf
local var=1
if [ $wan_mode -eq 1 ]; then
@ -125,6 +122,13 @@ EOF
fi
fi
mkdir -p /tmp/adbyby/rules/data mkdir -p /tmp/adbyby/rules/host
rm -f /tmp/adbyby/rules/data/* /tmp/adbyby/rules/host/*
cp -a /usr/share/adbyby/rules/data/* /tmp/adbyby/rules/data 2>/dev/null
cp -a /usr/share/adbyby/rules/host/* /tmp/adbyby/rules/host 2>/dev/null
echo 'addn-hosts=/tmp/adbyby/rules/host/' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
echo 'conf-dir=/tmp/adbyby/rules/data' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
[ $block_ios -eq 1 ] && echo 'address=/mesu.apple.com/0.0.0.0' >> /tmp/dnsmasq.d/dnsmasq-adbyby.conf
}