bulkdata: 2.1.1

This commit is contained in:
Amin Ben Romdhane 2023-05-15 11:46:52 +02:00
parent 8aeadf5fdc
commit f0d7922c40
3 changed files with 46 additions and 7 deletions

View file

@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=2.1.0
PKG_VERSION:=2.1.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
@ -44,8 +44,9 @@ endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/json
$(INSTALL_DIR) $(1)/etc/bbfdm/services
$(INSTALL_DIR) $(1)/etc/bbfdm/services/bulkdata
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/services/bulkdata
$(CP) ./files/* $(1)/
endef

View file

@ -0,0 +1,30 @@
{
"daemon": {
"config": {
"refresh_time": 3600,
"enable_plugins": 0
},
"input": {
"type": "JSON",
"name": "/etc/bbfdm/services/bulkdata/bulkdata.json"
},
"output": {
"type": "UBUS",
"name": "bbfdm.bulkdata"
}
},
"client": {
"config": {
"proto": "both",
"instance_mode": 0,
"enable_plugins": 0
},
"input": {
"type": "UBUS",
"name": "bbfdm.bulkdata"
},
"output": {
"type": "CLI"
}
}
}

View file

@ -5,6 +5,8 @@ STOP=10
USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
BBFDMD_PROG="/usr/sbin/bbfdmd"
BULKDATA_JSON_INPUT="/etc/bbfdm/services/bulkdata/input.json"
start_service() {
local enable
@ -12,12 +14,18 @@ start_service() {
config_load bulkdata
config_get_bool enable bulkdata enable 1
procd_open_instance bulkdata
procd_open_instance "bbfdm.bulkdata"
procd_set_param command "$BBFDMD_PROG"
procd_append_param command -I "${BULKDATA_JSON_INPUT}"
procd_set_param respawn
procd_close_instance "bbfdm.bulkdata"
[ "$enable" -eq "1" ] && {
procd_open_instance "bulkdata"
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
}
procd_close_instance
procd_set_param respawn
procd_close_instance "bulkdata"
}
}
reload_service() {