diff --git a/OpenWRT/Makefile b/OpenWRT/Makefile index 4b49357..2a24bb2 100644 --- a/OpenWRT/Makefile +++ b/OpenWRT/Makefile @@ -17,10 +17,10 @@ DEPENDS:= endef define Package/cronosagent/description - CronosAgent for BrandMeister DMR Master Server - Allows to connect Radio Activity KAIROS Repetaters to BrandMeister DMR Master Server - Radio Activity KAIROS should have built-in feature of External Server Access - which is available on firmware customization 008 (Radio Amateur community) + CronosAgent for BrandMeister DMR Master Server + Allows to connect Radio Activity KAIROS Repetaters to BrandMeister DMR Master Server + Radio Activity KAIROS should have built-in feature of External Server Access + which is available on firmware customization 008 (Radio Amateur community) endef define Build/Prepare @@ -28,20 +28,6 @@ define Build/Prepare $(CP) -R $(X_SOURCE_DIR)/* $(PKG_BUILD_DIR)/ endef -define Package/cronosagent/conffiles - /etc/config/cronosagent -endef - -define Package/cronosagent/postinst - #!/bin/sh - /etc/init.d/cronosagent enable -endef - -define Package/cronosagent/prerm - #!/bin/sh - /etc/init.d/cronosagent disable -endef - define Package/cronosagent/install $(INSTALL_DIR) $(1)/opt/CronosAgent $(INSTALL_DIR) $(1)/etc/init.d @@ -56,4 +42,21 @@ define Package/cronosagent/install $(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/model/cbi/cronosagent/configure.lua $(1)/usr/lib/lua/luci/model/cbi/cronosagent/ endef +define Package/cronosagent/conffiles +/etc/config/cronosagent +endef + +define Package/cronosagent/postinst +#!/bin/sh +/etc/init.d/cronosagent enable +exit 0 +endef + +define Package/cronosagent/prerm +#!/bin/sh +/etc/init.d/cronosagent stop +/etc/init.d/cronosagent disable +exit 0 +endef + $(eval $(call BuildPackage,cronosagent)) diff --git a/OpenWRT/controller/cronosagent.lua b/OpenWRT/controller/cronosagent.lua index 830fed0..d124873 100644 --- a/OpenWRT/controller/cronosagent.lua +++ b/OpenWRT/controller/cronosagent.lua @@ -10,5 +10,4 @@ function restartCronosAgent() luci.sys.init.stop("cronosagent") luci.sys.init.start("cronosagent") luci.http.write("Done!") - -- luci.http.redirect("/") end diff --git a/OpenWRT/init.d/cronosagent b/OpenWRT/init.d/cronosagent index c1dd6f7..29c63fe 100644 --- a/OpenWRT/init.d/cronosagent +++ b/OpenWRT/init.d/cronosagent @@ -10,3 +10,7 @@ start() { stop() { killall cronosagent } + +reload() { + restart +} \ No newline at end of file diff --git a/OpenWRT/model/cbi/cronosagent/configure.lua b/OpenWRT/model/cbi/cronosagent/configure.lua index a4043e4..b9056a4 100644 --- a/OpenWRT/model/cbi/cronosagent/configure.lua +++ b/OpenWRT/model/cbi/cronosagent/configure.lua @@ -1,4 +1,9 @@ +local function handleAferCommit() + luci.sys.init.stop("cronosagent") + luci.sys.init.start("cronosagent") +end + local map = Map("cronosagent", "CronosAgent") local section = map:section(TypedSection, "cronosagent", "Configuration") @@ -7,11 +12,13 @@ local repeater = section:option(Value, "repeaterAddress", "Repeater Address", "A local server = section:option(Value, "serverAddress", "Server address", "Address of BrandMeister DMR Server") local password = section:option(Value, "serverPassword", "Password", "Password to login to the server" ) -number.datatype = "range(1,16777215)" -repeater.datatype = "ip4addr" +number.datatype = "range(1,16777215)" +repeater.datatype = "ip4addr" -server.datatype = "host" -password.datatype = "string" -password.password = true +server.datatype = "host" +password.datatype = "string" +password.password = true + +map.on_after_commit = handleAferCommit return map \ No newline at end of file diff --git a/Version.h b/Version.h index 0322a78..e44780b 100644 --- a/Version.h +++ b/Version.h @@ -1 +1 @@ -#define VERSION 20160731 +#define VERSION 20160804