Added init.d script for OpenWRT
This commit is contained in:
parent
4a79416649
commit
3008556106
5 changed files with 14 additions and 0 deletions
5
OpenWRT/config/cronosagent
Normal file
5
OpenWRT/config/cronosagent
Normal file
|
@ -0,0 +1,5 @@
|
|||
config cronosagent
|
||||
option number '123456'
|
||||
option repeaterAddress '1.1.1.1'
|
||||
option serverAddress 'master.dstar.su'
|
||||
option serverPassword 'password'
|
14
OpenWRT/controller/cronosagent.lua
Normal file
14
OpenWRT/controller/cronosagent.lua
Normal 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
|
14
OpenWRT/init.d/cronosagent
Normal file
14
OpenWRT/init.d/cronosagent
Normal 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
|
||||
}
|
17
OpenWRT/model/cbi/cronosagent/configure.lua
Normal file
17
OpenWRT/model/cbi/cronosagent/configure.lua
Normal 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
3
OpenWRT/readme.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
/usr/lib/lua/luci/controller/cronosagent.lua
|
||||
/usr/lib/lua/luci/model/cbi/cronosagent/configure.lua
|
||||
/etc/config/cronosagent
|
Loading…
Add table
Add a link
Reference in a new issue