luci-app-mosdns: print mosdns version on Luci. close #60

This commit is contained in:
sbwml 2023-03-25 02:46:16 +08:00
parent 0e21e1554f
commit bd89c52b99
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,10 @@
if nixio.fs.access("/usr/bin/mosdns") then
mosdns_version=luci.sys.exec("/usr/share/mosdns/mosdns.sh version")
else
mosdns_version="Unknown Version"
end
m = Map("mosdns")
m.title = translate("MosDNS")
m.title = translate("MosDNS") .. " " .. mosdns_version
m.description = translate("MosDNS is a 'programmable' DNS forwarder.")
m:section(SimpleSection).template = "mosdns/mosdns_status"

View File

@ -100,6 +100,9 @@ case $script_action in
"adlist_update")
adlist_update && restart_service
;;
"version")
mosdns version
;;
*)
exit 0
;;