summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-https_dns_proxy/luasrc/controller
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.net>2019-11-13 04:25:53 -0700
committerStan Grishin <stangri@melmac.net>2019-11-13 04:25:53 -0700
commit5a81e4f6c1d556de3d7fbdabfc68ba6a1429dcfc (patch)
treeb8183182edd97ae07d1d0faec4479ea44a0afe8a /applications/luci-app-https_dns_proxy/luasrc/controller
parent8da8f38bf97c925f6f113d3b4793edb23e7e0dc2 (diff)
luci-app-https_dns_proxy: remove dnsmasq integration, better service controls, providers as plugins, misc fixes
Signed-off-by: Stan Grishin <stangri@melmac.net>
Diffstat (limited to 'applications/luci-app-https_dns_proxy/luasrc/controller')
-rw-r--r--applications/luci-app-https_dns_proxy/luasrc/controller/https_dns_proxy.lua24
1 files changed, 21 insertions, 3 deletions
diff --git a/applications/luci-app-https_dns_proxy/luasrc/controller/https_dns_proxy.lua b/applications/luci-app-https_dns_proxy/luasrc/controller/https_dns_proxy.lua
index e1fd8fcb9b..826f3f691f 100644
--- a/applications/luci-app-https_dns_proxy/luasrc/controller/https_dns_proxy.lua
+++ b/applications/luci-app-https_dns_proxy/luasrc/controller/https_dns_proxy.lua
@@ -1,7 +1,25 @@
module("luci.controller.https_dns_proxy", package.seeall)
function index()
- if not nixio.fs.access("/etc/config/https_dns_proxy") then
- return
+ if nixio.fs.access("/etc/config/https_dns_proxy") then
+ entry({"admin", "services", "https_dns_proxy"}, cbi("https_dns_proxy"), _("DNS over HTTPS Proxy"))
+ entry({"admin", "services", "https_dns_proxy", "action"}, call("https_dns_proxy_action"), nil).leaf = true
end
- entry({"admin", "services", "https_dns_proxy"}, cbi("https_dns_proxy"), _("HTTPS DNS Proxy"))
+end
+
+function https_dns_proxy_action(name)
+ local packageName = "https_dns_proxy"
+ if name == "start" then
+ luci.sys.init.start(packageName)
+ elseif name == "action" then
+ luci.util.exec("/etc/init.d/" .. packageName .. " reload >/dev/null 2>&1")
+ luci.util.exec("/etc/init.d/dnsmasq restart >/dev/null 2>&1")
+ elseif name == "stop" then
+ luci.sys.init.stop(packageName)
+ elseif name == "enable" then
+ luci.sys.init.enable(packageName)
+ elseif name == "disable" then
+ luci.sys.init.disable(packageName)
+ end
+ luci.http.prepare_content("text/plain")
+ luci.http.write("0")
end