mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-27 17:37:18 +01:00
mqtt_ciotc: prepare pkg and files properly
This commit is contained in:
parent
c9cf69ee54
commit
73cae5d93a
5 changed files with 40 additions and 39 deletions
|
|
@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||
PKG_NAME:=mqtt-ciotc
|
||||
PKG_VERSION:=0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=eda5bc711c215cbfe50ddd0e8725b69d4a3cff4f
|
||||
PKG_SOURCE_VERSION:=00da3fb1f1691d836037dc4d93e38d0835ba46a4
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifilife-testbed.git
|
||||
|
||||
|
|
@ -29,6 +29,7 @@ define Package/mqtt-ciotc/description
|
|||
endef
|
||||
|
||||
define Package/mqtt-ciotc/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mqtt_ciotc $(1)/sbin/
|
||||
endef
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
config mqtt-ciotc mqtt-ciotc
|
||||
option private-cert '/etc/mqtt-ciotc/rsa_private.pem'
|
||||
option root-cert '/etc/mqtt-ciotc/roots.pem'
|
||||
3
mqtt-ciotc/files/etc/config/mqtt_ciotc
Normal file
3
mqtt-ciotc/files/etc/config/mqtt_ciotc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
config certs 'certs'
|
||||
option private '/etc/mqtt-ciotc/rsa_private.pem'
|
||||
option root '/etc/mqtt-ciotc/roots.pem'
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=10
|
||||
PROG=/sbin/mqtt-ciotc
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
config_load mqtt-ciotc
|
||||
config_get private-cert mqtt-ciotc private-cert
|
||||
config_get root-cert mqtt-ciotc root-cert
|
||||
|
||||
[ -n $private-cert ] && procd_append_param command --private-cert $private-cert
|
||||
[ -n $root-cert ] && procd_append_param command --root-cert $root-cert
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
service_stop ${PROG}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# procd_send_signal wifilife # use SIGHUP
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "mqtt-ciotc"
|
||||
}
|
||||
35
mqtt-ciotc/files/etc/init.d/mqtt_ciotc
Executable file
35
mqtt-ciotc/files/etc/init.d/mqtt_ciotc
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=10
|
||||
PROG=/sbin/mqtt_ciotc
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
config_load mqtt_ciotc
|
||||
config_get private certs private
|
||||
config_get root certs root
|
||||
|
||||
[ -n $private ] && procd_append_param command --private-cert $private
|
||||
[ -n $root ] && procd_append_param command --root-cert $root
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
service_stop ${PROG}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# procd_send_signal wifilife # use SIGHUP
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "mqtt_ciotc"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue