mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
bbfdm: 1.4.11
This commit is contained in:
parent
3b3d7150bd
commit
71bbb8281c
4 changed files with 40 additions and 4 deletions
|
|
@ -5,13 +5,13 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=bbfdm
|
PKG_NAME:=bbfdm
|
||||||
PKG_VERSION:=1.4.10
|
PKG_VERSION:=1.4.11
|
||||||
|
|
||||||
USE_LOCAL:=0
|
USE_LOCAL:=0
|
||||||
ifneq ($(USE_LOCAL),1)
|
ifneq ($(USE_LOCAL),1)
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||||
PKG_SOURCE_VERSION:=7ecae3f6d146dc65d6a7362da1e28ee9de064860
|
PKG_SOURCE_VERSION:=2358c7ce39d4770c77ca78f3a152adf0522d7387
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||||
PKG_MIRROR_HASH:=skip
|
PKG_MIRROR_HASH:=skip
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -15,3 +15,33 @@ bbfdm_add_service()
|
||||||
|
|
||||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
|
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bbfdm_stop_service()
|
||||||
|
{
|
||||||
|
local name
|
||||||
|
|
||||||
|
name="${1}"
|
||||||
|
if [ -z "${name}" ]; then
|
||||||
|
return 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ubus call service list '{"name":"bbfdm.services"}' |grep -q "bbfdm.$name"; then
|
||||||
|
ubus call service delete "{'name':'bbfdm.services','instance':'bbfdm.$name'}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
usages()
|
||||||
|
{
|
||||||
|
echo "Usages $0: <OPTIONS>..."
|
||||||
|
echo
|
||||||
|
echo " -h show help"
|
||||||
|
echo " -k micro-service name to stop"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
while getopts "s:k:h" opts; do
|
||||||
|
case "$opts" in
|
||||||
|
h) usages; exit 0;;
|
||||||
|
k) bbfdm_stop_service "${OPTARG}";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,5 @@ config bbfdmd 'bbfdmd'
|
||||||
option loglevel '1'
|
option loglevel '1'
|
||||||
option refresh_time '10'
|
option refresh_time '10'
|
||||||
option transaction_timeout '30'
|
option transaction_timeout '30'
|
||||||
|
option subprocess_level '2'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ validate_bbfdm_bbfdmd_section()
|
||||||
configure_bbfdmd()
|
configure_bbfdmd()
|
||||||
{
|
{
|
||||||
local enabled debug sock update
|
local enabled debug sock update
|
||||||
local jlog jrefresh jtimeout
|
local jlog jrefresh jtimeout jlevel
|
||||||
|
|
||||||
update=0
|
update=0
|
||||||
config_load bbfdm
|
config_load bbfdm
|
||||||
|
|
@ -55,8 +55,13 @@ configure_bbfdmd()
|
||||||
update=1
|
update=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
jlevel="$(jq '.daemon.config.subprocess_level' ${BBFDM_JSON_INPUT})"
|
||||||
|
if [ "\"${subprocess_level}\"" != "${jlevel}" ]; then
|
||||||
|
update=1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${update}" -eq "1" ]; then
|
if [ "${update}" -eq "1" ]; then
|
||||||
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
|
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
|
||||||
mv ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
|
mv ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue