4
Fork 0

Added init.d script for OpenWRT

This commit is contained in:
R3ABM Artem 2016-08-02 08:30:38 +03:00
parent 4a79416649
commit 3008556106
5 changed files with 14 additions and 0 deletions

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

@ -0,0 +1,14 @@
module("luci.controller.cronosagent", package.seeall)
function index()
entry({ "admin", "cronosagent" }, alias("admin", "cronosagent", "configure", "restart"), "CronosAgent")
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

View file

@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common
START=10
STOP=15
start() {
echo start
# commands to launch application
}
stop() {
echo stop
# commands to kill application
}

View file

@ -0,0 +1,17 @@
local map = Map("cronosagent", "CronosAgent")
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" )
local server = section:option(Value, "serverAddress", "Server address", "Address of BrandMeister DMR Server")
local password = section:option(Value, "serverPassword", "Password", "Password to login" )
number.datatype = "range(1,16777215)"
repeater.datatype = "ip4addr"
server.datatype = "host"
password.datatype = "string"
password.password = true
return map

3
OpenWRT/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