luci-app-adbyby-plus: add block douyin option

This commit is contained in:
coolsnowwolf 2020-05-26 19:09:01 +08:00
parent f3339baf3c
commit 458564b2b9
4 changed files with 20 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# Copyright (C) 2016 Openwrt.org
# Copyright (C) 2020 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
@ -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:=71
PKG_RELEASE:=72
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -22,6 +22,11 @@ o.title = translate("Block Apple iOS OTA update")
o.default = 0
o.rmempty = false
o = s:option(Flag, "block_douyin")
o.title = translate("Block Douyin APP and Website")
o.default = 0
o.rmempty = false
o = s:option(Flag, "cron_mode")
o.title = translate("Update the rule at 6 a.m. every morning and restart adbyby")
o.default = 0

View File

@ -112,6 +112,9 @@ msgstr "手动更新规则"
msgid "Block Apple iOS OTA update"
msgstr "拦截 Apple iOS 的OTA更新"
msgid "Block Douyin APP and Website"
msgstr "拦截 抖音 APP 和网站"
msgid "RAM Running Mode"
msgstr "内存运行模式"

View File

@ -34,6 +34,7 @@ get_config()
config_get wan_mode $1 wan_mode 1
config_get_bool block_ios $1 block_ios 0
config_get_bool mem_mode $1 mem_mode 1
config_get_bool block_douyin $1 block_douyin 0
}
add_rules()
@ -131,6 +132,13 @@ add_dns()
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
if [ $block_douyin -eq 1 ]; then
cat <<-EOF >/tmp/etc/dnsmasq-adbyby.d/08-dnsmasq.douyin
address=/api.amemv.com/0.0.0.0
address=/.snssdk.com/0.0.0.0
address=/.douyin.com/0.0.0.0
EOF
fi
}
del_dns()
@ -201,7 +209,7 @@ start()
add_dns
add_rule
/etc/init.d/dnsmasq reload
/etc/init.d/dnsmasq restart
fi
}
@ -213,7 +221,7 @@ stop()
del_rule
del_cron
del_dns
/etc/init.d/dnsmasq reload
/etc/init.d/dnsmasq restart
}
boot()