4
Fork 0

Tested on OpenWRT

This commit is contained in:
R3ABM Artem 2016-08-02 00:21:24 +03:00
parent bf22e37565
commit 7acd64f276
4 changed files with 15 additions and 3 deletions

View file

@ -1,12 +1,14 @@
module("cronosagent", package.seeall)
module("luci.controller.cronosagent", package.seeall)
function index()
entry({ "admin", "cronosagent" }, alias("admin", "cronosagent", "configure", "restart"), "CronosAgent")
entry({ "admin", "cronosagent", "configure" }, cbi("cronosagent"), "Configure", 10)
entry({ "admin", "cronosagent", "configure" }, cbi("cronosagent/configure"), "Configure", 10)
entry({ "admin", "cronosagent", "restart" }, call("restartCronosAgent"), "Restart", 20)
end
function restartCronosAgent()
luci.sys.init.stop("cronosagent")
luci.sys.init.start("cronosagent")
luci.http.write("Done!")
-- luci.http.redirect("/")
end

5
LuCI/cronosagent Normal file
View file

@ -0,0 +1,5 @@
config cronosagent
option number '123456'
option repeaterAddress '1.1.1.1'
option serverAddress 'master.dstar.su'
option serverPassword 'password'

View file

@ -1,6 +1,6 @@
local map = Map("cronosagent", "CronosAgent")
local section = map:section(TypedSection, "global", "", "Configuration")
local section = map:section(TypedSection, "cronosagent", "Configuration")
local number = section:option(Value, "number", "Repeater ID", "DMR ID assigned to your repeater" )
local repeater = section:option(Value, "repeaterAddress", "Repeater Address", "Address of your KAIROS repeater" )
@ -13,3 +13,5 @@ repeater.datatype = "ip4addr"
server.datatype = "host"
password.datatype = "string"
password.password = true
return map

3
LuCI/readme.txt Normal file
View file

@ -0,0 +1,3 @@
/usr/lib/lua/luci/controller/cronosagent.lua
/usr/lib/lua/luci/model/cbi/cronosagent/configure.lua
/etc/config/cronosagent