-- Copyright 2017 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
local fs = require("nixio.fs")
local util = require("luci.util")
local uci = require("uci")
-- Copyright 2017 Dirk Brenken (dev@brenken.org)
-- This is free software, licensed under the Apache License, Version 2.0
local fs = require("nixio.fs")
local util = require("luci.util")
local uci = require("uci")
if not nixio.fs.access(adbinput) then
m = SimpleForm("error", nil, translate("Input file not found, please check your configuration."))
if not nixio.fs.access(adbinput) then
m = SimpleForm("error", nil, translate("Input file not found, please check your configuration."))
s = m:section(SimpleSection, nil,
translatef("This form allows you to modify the content of the adblock blacklist (%s).<br />", adbinput)
.. translate("Please add only one domain per line. Comments introduced with '#' are allowed - ip addresses, wildcards and regex are not."))
f = s:option(TextValue, "data")
s = m:section(SimpleSection, nil,
translatef("This form allows you to modify the content of the adblock blacklist (%s).<br />", adbinput)
.. translate("Please add only one domain per line. Comments introduced with '#' are allowed - ip addresses, wildcards and regex are not."))
f = s:option(TextValue, "data")
- function f.write(self, section, data)
- return nixio.fs.writefile(adbinput, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n")
- end
+function f.write(self, section, data)
+ return nixio.fs.writefile(adbinput, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n")
+end