luci-app-adbyby-plus: keed adblock after upgrade

This commit is contained in:
LEAN-ESX 2020-03-12 07:48:51 -07:00 committed by CN_SZTL
parent daae45bb5e
commit 8f132c0047
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
5 changed files with 6 additions and 6 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:=63
PKG_RELEASE:=65
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -47,7 +47,7 @@ luci.sys.exec("/usr/share/adbyby/rule-update")
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("rm -rf /usr/share/adbyby/rules/* && cp -a /tmp/rules /usr/share/adbyby/")
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")
retstring=tostring(math.ceil(tonumber(icount)))
else

View File

@ -41,8 +41,7 @@ o.description = translate("AdGuardHome / Host / DNSMASQ rules auto-convert")
o = s:option(Button,"delete",translate("Delete All Subscribe Rules"))
o.inputstyle = "reset"
o.write = function()
SYS.exec("rm -rf /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/*")
SYS.exec("mkdir -p /usr/share/adbyby/rules/data/ /usr/share/adbyby/rules/host/")
SYS.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/*")
SYS.exec("/etc/init.d/adbyby restart 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adbyby", "advanced"))
end

View File

@ -106,7 +106,7 @@ add_dns()
{
mkdir -p /var/etc/dnsmasq-adbyby.d
mkdir -p /tmp/dnsmasq.d
mkdir -p /usr/share/adbyby/rules/host /usr/share/adbyby/rules/data
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

View File

@ -2,4 +2,5 @@
/usr/share/adbyby/adblack.conf
/usr/share/adbyby/blockip.conf
/usr/share/adbyby/adesc.conf
/usr/share/adbyby/rules.txt
/usr/share/adbyby/rules.txt
/usr/share/adbyby/dnsmasq.adblock