mirror of
https://github.com/kenzok8/small-package
synced 2025-01-08 13:27:36 +08:00
update 05-02 07:46:17
This commit is contained in:
parent
1aee447574
commit
48b94570c8
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-dnsfilter
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=12
|
||||
PKG_RELEASE:=13
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_MAINTAINER:=small_5 kiddin9
|
||||
|
@ -1,4 +1,4 @@
|
||||
module("luci.controller.dnsfilter",package.seeall)
|
||||
module("luci.controller.dnsfilter", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/dnsfilter") then
|
||||
|
@ -52,24 +52,24 @@ o.description = translate("Should be enabled when rules addresses are slow to do
|
||||
o.rmempty = false
|
||||
o.default = 0
|
||||
|
||||
if tmp_rule==1 then
|
||||
if tmp_rule == 1 then
|
||||
o = s:option(Button, "delete", translate("Delete All Subscribe Rules"))
|
||||
o.inputstyle = "reset"
|
||||
o.description = translate("Delete rules files and delete the subscription link<br/>There is no need to click for modify the subscription link,The script will automatically replace the old rule file")
|
||||
o.write = function()
|
||||
SYS.exec("[ -d /etc/dnsfilter/rules ] && rm -rf /etc/dnsfilter/rules")
|
||||
SYS.exec("grep -wq 'list url' /etc/config/dnsfilter && sed -i '/list url/d' /etc/config/dnsfilter && /etc/init.d/dnsfilter restart 2>&1 &")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin","services","dnsfilter","base"))
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "dnsfilter", "base"))
|
||||
end
|
||||
end
|
||||
|
||||
if luci.sys.call("[ -h /tmp/dnsfilter/url ] || exit 9")==9 then
|
||||
if luci.sys.call("[ -h /tmp/dnsfilter/url ] || exit 9") == 9 then
|
||||
if nixio.fs.access("/etc/dnsfilter/rules") then
|
||||
o = s:option(Button, "delete_1", translate("Delete Subscribe Rules On The Flash"))
|
||||
o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
SYS.exec("rm -rf /etc/dnsfilter/rules")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin","services","dnsfilter","base"))
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "dnsfilter", "base"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4,7 +4,7 @@ local conffile = "/etc/dnsfilter/black.list"
|
||||
f = SimpleForm("custom")
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows=13
|
||||
t.rows = 13
|
||||
t.description = translate("Will Always block these Domain")
|
||||
|
||||
function t.cfgvalue()
|
||||
|
@ -4,7 +4,7 @@ local conffile = "/etc/dnsfilter/ip.list"
|
||||
f = SimpleForm("custom")
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows=13
|
||||
t.rows = 13
|
||||
t.description = translate("Will Always block these IP")
|
||||
|
||||
function t.cfgvalue()
|
||||
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-dnsfilter": {
|
||||
"description": "Grant UCI access for luci-app-dnsfilter",
|
||||
"read": {
|
||||
"uci": [ "dnsfilter" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "dnsfilter" ]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user