From 1ba2d5ab8962f572211632d12053de8ec95e173c Mon Sep 17 00:00:00 2001 From: vdutta Date: Thu, 24 Nov 2022 19:45:00 +0530 Subject: [PATCH] obuspa: 6.0.0.10 --- obuspa/Makefile | 2 +- obuspa/files/etc/init.d/obuspa | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/obuspa/Makefile b/obuspa/Makefile index 24b23a1df..8b2927ab4 100644 --- a/obuspa/Makefile +++ b/obuspa/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=obuspa -PKG_VERSION:=6.0.0.9 +PKG_VERSION:=6.0.0.10 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) diff --git a/obuspa/files/etc/init.d/obuspa b/obuspa/files/etc/init.d/obuspa index e3ad65348..ab5ab47c9 100755 --- a/obuspa/files/etc/init.d/obuspa +++ b/obuspa/files/etc/init.d/obuspa @@ -81,6 +81,14 @@ db_set() fi } +update_db_dump() +{ + if [ -f "${DB_DUMP}" ]; then + rm ${DB_DUMP} + ${PROG} -f ${SQL_DB_FILE} -c show database |sort > ${DB_DUMP} + fi +} + # if db present then check if it matches with existing instances # fallback to max instance present + 1 # In case of no db get the count @@ -352,6 +360,7 @@ configure_localagent() } db_set Device.LocalAgent.EndpointID "${EndpointID}" + update_db_dump } update_reset_reason() @@ -447,6 +456,7 @@ configure_controller() done db_set + update_db_dump } configure_subscription() @@ -580,7 +590,6 @@ configure_mtp() { log "Validation of mtp section failed" return 1; } - sec="${sec/mtp_/cpe-}" get_base_path "Device.LocalAgent.MTP." "${sec}" if [ -z "${BASEPATH}" ]; then @@ -624,6 +633,7 @@ configure_mtp() { db_set "${BASEPATH}.WebSocket.EnableEncryption" "${EnableEncryption}" fi db_set + update_db_dump } configure_stomp_connection() { @@ -655,9 +665,10 @@ configure_stomp_connection() { db_set "${BASEPATH}.EnableHeartbeats" "${EnableHeartbeats}" db_set "${BASEPATH}.VirtualHost" "${VirtualHost}" db_set + update_db_dump } -configure_mqtt_client(){ +configure_mqtt_client() { local BrokerAddress BrokerPort Enable Username Password ProtocolVersion local TransportProtocol ClientID local sec @@ -686,6 +697,7 @@ configure_mqtt_client(){ db_set "${BASEPATH}.ClientID" "${ClientID}" db_set + update_db_dump } @@ -955,7 +967,6 @@ delete_sql_db_entry_with_pattern() fi if [ "${#pattern}" -lt 7 ]; then - log "Invalid pattern ${1}" return 0; fi @@ -970,7 +981,7 @@ check_n_delete_db() local sec t r path sec="${1}" - if uci -q get obuspa.${sec}; then + if uci -q get obuspa.${sec} >/dev/null 2>&1; then return 0 fi