Merge pull request #2071 from Andy2244/luci-app-samba4-timemachine
[oweals/luci.git] / applications / luci-app-nut / luasrc / controller / nut.lua
1 -- Copyright 2015 Daniel Dickinson <openwrt@daniel.thecshore.com>
2 -- Licensed to the public under the Apache License 2.0.
3
4 module("luci.controller.nut", package.seeall)
5
6 function index()
7         if not nixio.fs.access("/etc/config/nut_server") and not nixio.fs.access("/etc/config/nut_monitor") and not nixio.fs.access("/etc/config/nut_cgi") then
8                 return
9         end
10
11         entry({"admin", "services", "nut"}, firstchild(), _("Network UPS Tools"))
12
13         if nixio.fs.access("/etc/config/nut_server") then
14                 entry({"admin", "services", "nut", "server"}, cbi("nut_server"), _("Network UPS Tools (Server)"), 20)
15         end
16
17         if nixio.fs.access("/etc/config/nut_monitor") then
18                 entry({"admin", "services", "nut", "monitor"}, cbi("nut_monitor"), _("Network UPS Tools (Monitor)"), 30)
19         end
20
21         if nixio.fs.access("/etc/config/nut_cgi") then
22                 entry({"admin", "services", "nut", "cgi"}, cbi("nut_cgi"), _("Network UPS Tools (CGI)"), 40)
23         end
24 end
25