diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2019-12-19 20:50:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-19 20:50:05 +0200 |
commit | a3b29fac6f06c5bb9df38cb8371c3b771f9fb78a (patch) | |
tree | a6ee3feda0229ce1185c1ffda737807ebeb39e01 /applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua | |
parent | 3a657b8ab585f6e0fef5c9128dc84c5a008a6969 (diff) | |
parent | 43ddf0cd12ffdcbe6c5d760293cddcbe35968801 (diff) |
Merge pull request #3421 from stangri/master-luci-app-https-dns-proxy
luci-app-https-dns-proxy: package name change, support for RFC8484 binary
Diffstat (limited to 'applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua')
-rw-r--r-- | applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua | 25 |
1 files changed, 25 insertions, 0 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 new file mode 100644 index 0000000000..d236feae0a --- /dev/null +++ b/applications/luci-app-https-dns-proxy/luasrc/controller/https-dns-proxy.lua @@ -0,0 +1,25 @@ +module("luci.controller.https-dns-proxy", package.seeall) +function index() + 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 +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 |