mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 03:09:08 +08:00
luci-app-adbyby-plus: keed adblock after upgrade
This commit is contained in:
parent
daae45bb5e
commit
8f132c0047
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user