|
@@ -1,9 +1,7 @@
|
|
module("luci.controller.AdGuardHome",package.seeall)
|
|
module("luci.controller.AdGuardHome",package.seeall)
|
|
nixio=require"nixio"
|
|
nixio=require"nixio"
|
|
|
|
+local uci=require"luci.model.uci".cursor()
|
|
function index()
|
|
function index()
|
|
-if not nixio.fs.access("/etc/config/AdGuardHome")then
|
|
|
|
-return
|
|
|
|
-end
|
|
|
|
entry({"admin","services","AdGuardHome"},firstchild(),_("AdGuard Home"),30).dependent=true
|
|
entry({"admin","services","AdGuardHome"},firstchild(),_("AdGuard Home"),30).dependent=true
|
|
entry({"admin","services","AdGuardHome","general"},cbi("AdGuardHome"),_("Base Setting"),1)
|
|
entry({"admin","services","AdGuardHome","general"},cbi("AdGuardHome"),_("Base Setting"),1)
|
|
entry({"admin","services","AdGuardHome","log"},form("AdGuardHomelog"),_("Log"),2)
|
|
entry({"admin","services","AdGuardHome","log"},form("AdGuardHomelog"),_("Log"),2)
|
|
@@ -14,7 +12,8 @@ end
|
|
|
|
|
|
function act_status()
|
|
function act_status()
|
|
local e={}
|
|
local e={}
|
|
- e.running=luci.sys.call("pgrep -f AdGuardHome >/dev/null")==0
|
|
|
|
|
|
+ binpath=uci:get("AdGuardHome","AdGuardHome","binpath")
|
|
|
|
+ e.running=luci.sys.call("pgrep "..binpath.." >/dev/null")==0
|
|
luci.http.prepare_content("application/json")
|
|
luci.http.prepare_content("application/json")
|
|
luci.http.write_json(e)
|
|
luci.http.write_json(e)
|
|
end
|
|
end
|