From 78c895f23addb623ccf44fbe74173b7bfe4bb17c Mon Sep 17 00:00:00 2001 From: vdutta Date: Tue, 13 Jul 2021 20:53:46 +0530 Subject: [PATCH] obuspa: Remove dependency of mosquitto_pub in init --- obuspa/Makefile | 2 +- obuspa/files/etc/init.d/obuspa | 24 ------------------------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/obuspa/Makefile b/obuspa/Makefile index 3a7f8c59f..e800c54af 100644 --- a/obuspa/Makefile +++ b/obuspa/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=obuspa -PKG_VERSION:=4.0.0.9 +PKG_VERSION:=4.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 bd7375779..8caa11323 100755 --- a/obuspa/files/etc/init.d/obuspa +++ b/obuspa/files/etc/init.d/obuspa @@ -648,31 +648,7 @@ remove_db() { } service_running() { - local AgentEndpointID serial oui user pass - local opt="" - ubus -t 10 wait_for usp.raw - config_load obuspa - config_get AgentEndpointID localagent EndpointID "" - if [ -z "${AgentEndpointID}" ]; then - serial=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.SerialNumber"}'|jsonfilter -e '@["parameters"][0].value') - oui=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.ManufacturerOUI"}'|jsonfilter -e '@["parameters"][0].value') - AgentEndpointID="os::${oui}-${serial}" - fi - - config_get user localmqtt Username - if [ -n "${user}" ]; then - opt="-u ${user}" - fi - config_get pass localmqtt Password - if [ -n "${pass}" ]; then - opt="${opt} -P ${pass}" - fi - # publish Agent's EndpointID in mosquito broker for discovery - # This is a work around till obuspa does not support advertising - log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker" - mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" ${opt} - procd_running ${CONFIGURATION} }