diff --git a/package/lean/luci-app-adbyby-plus/Makefile b/package/lean/luci-app-adbyby-plus/Makefile
index c08b00b15..ad6623a4d 100644
--- a/package/lean/luci-app-adbyby-plus/Makefile
+++ b/package/lean/luci-app-adbyby-plus/Makefile
@@ -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:=19
+PKG_RELEASE:=20
include $(TOPDIR)/feeds/luci/luci.mk
diff --git a/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua b/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua
index 694dbbb12..87b9971d4 100644
--- a/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua
+++ b/package/lean/luci-app-adbyby-plus/luasrc/model/cbi/adbyby.lua
@@ -70,7 +70,8 @@ o.description = translate(string.format("%s
", Status))
o.description = translate(string.format("Lazy Rule:%s Video Rule:%s
Third Party Subscription Rule:%d lines User-defined Rule:%d lines", DL, DV, math.abs(NR-NU), NR))
o.inputstyle = "reload"
o.write = function()
- SYS.call("/etc/init.d/adbyby restart")
+ SYS.call("nohup sh /usr/share/adbyby/adupdate.sh > /tmp/adupdate.log 2>&1 &")
+ SYS.call("sleep 4")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
@@ -82,7 +83,6 @@ o.default = 0
o.rmempty = false
o.description = translate(string.format("Adblock Plus Host List: %s Lines
", ND))
-
updatead = s:taboption("advanced", Button, "updatead", translate("Manually force update
Adblock Plus Host List"), translate("Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run.
After completed it would automatically refresh, please do not duplicate click!"))
updatead.inputtitle = translate("Manually force update")
updatead.inputstyle = "apply"
@@ -90,6 +90,11 @@ updatead.write = function()
SYS.call("nohup sh /usr/share/adbyby/adblock.sh > /tmp/adupdate.log 2>&1 &")
end
+o = s:taboption("advanced", Flag, "update_source")
+o.title = translate("Update adbyby rules form official website first")
+o.default = 1
+o.rmempty = false
+
o = s:taboption("advanced", Flag, "block_ios")
o.title = translate("Block Apple iOS OTA update")
o.default = 0
diff --git a/package/lean/luci-app-adbyby-plus/po/zh-cn/adbyby.po b/package/lean/luci-app-adbyby-plus/po/zh-cn/adbyby.po
index 045517d21..b0842860c 100644
--- a/package/lean/luci-app-adbyby-plus/po/zh-cn/adbyby.po
+++ b/package/lean/luci-app-adbyby-plus/po/zh-cn/adbyby.po
@@ -114,5 +114,12 @@ msgstr "Adblock Plus Host 列表:"
msgid "Note: It needs to download and convert the rules. The background process may takes 60-120 seconds to run.
After completed it would automatically refresh, please do not duplicate click!"
msgstr "注意:需要下载并转换规则。后台进程可能需要60-120秒运行。完成后会自动刷新,请不要重复点击!"
+msgid "No filter"
+msgstr "不过滤"
+msgid "Global filter"
+msgstr "全局过滤"
+
+msgid "Update adbyby rules form official website first"
+msgstr "优先从官方网站更新规则"
diff --git a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh
index 2f47f35da..9f6bef759 100755
--- a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh
+++ b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adupdate.sh
@@ -1,8 +1,14 @@
#!/bin/sh
-wget -t 1 -T 10 -O /tmp/lazy.txt http://update.adbyby.com/rule3/lazy.jpg
-wget -t 1 -T 10 -O /tmp/video.txt http://update.adbyby.com/rule3/video.jpg
-wget -t 1 -T 10 -O /tmp/user.action http://update.adbyby.com/rule3/user.action
+update_source=$(uci get adbyby.@adbyby[0].update_source 2>/dev/null)
+
+rm -f /usr/share/adbyby/data/*.bak
+
+if [ $update_source -eq 1 ]; then
+ wget -t 1 -T 10 -O /tmp/lazy.txt http://update.adbyby.com/rule3/lazy.jpg
+ wget -t 1 -T 10 -O /tmp/video.txt http://update.adbyby.com/rule3/video.jpg
+ wget -t 1 -T 10 -O /tmp/user.action http://update.adbyby.com/rule3/user.action
+fi
[ ! -s "/tmp/lazy.txt" ] && wget --no-check-certificate -O /tmp/lazy.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt
[ ! -s "/tmp/video.txt" ] && wget --no-check-certificate -O /tmp/video.txt https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt