obuspa: Free cached data and fix init script

This commit is contained in:
vdutta 2020-11-28 20:03:15 +05:30
parent 2506c9874a
commit 38bf0e3c89
3 changed files with 14 additions and 10 deletions

View file

@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=3.0.0.0
PKG_VERSION:=3.0.0.1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=8e8cfcbd3b651bd39cb93398042af0df3155486c
PKG_SOURCE_VERSION:=24779ef2696ac1d431abfd78cdb15578525b24b3
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
endif

View file

@ -6,7 +6,7 @@ config obuspa 'global'
option ifname 'br-lan'
option debug 'false'
option log_level '1'
option db_file '/tmp/usp.db'
#option db_file '/tmp/usp.db'
#option log_dest '/var/log/obuspa'
# Configures Device.LocalAgent and Controller boot prameters

View file

@ -29,12 +29,12 @@ validate_obuspa_section()
{
uci_validate_section ${CONFIGURATION} obuspa "${1}" \
'enabled:bool:true' \
'cert:string:"/etc/obuspa/rootCA.pem"' \
'cert:string:/etc/obuspa/rootCA.pem' \
'ifname:string:"br-lan"' \
'debug:bool:false' \
'log_level:uinteger:2' \
'log_dest:string:stdout' \
'db_file:string:"/tmp/usp.db"'
'log_dest:string' \
'db_file:string'
}
validate_localagent_section()
@ -364,14 +364,18 @@ configure_obuspa() {
grep -q "export USP_BOARD_IFNAME=${ifname}" /root/.profile || \
echo "export USP_BOARD_IFNAME=${ifname}" >> /root/.profile
echo "${db_file}" >>${KEEP_FILES}
if [ -n "${db_file}" ]; then
procd_append_param command -f ${db_file}
echo "${db_file}" >>${KEEP_FILES}
if [ -f "${db_file}" ]; then
procd_append_param command -f ${db_file}
fi
fi
if [ -e "${cert}" ]; then
procd_append_param command -t ${cert}
if [ -n "${cert}" ]; then
echo "${cert}" >>${KEEP_FILES}
if [ -f "${cert}" ]; then
procd_append_param command -t ${cert}
fi
fi
procd_set_param env USP_BOARD_IFNAME=${ifname}