From 748e2500f68008c0777ee71fd9afa005361ee78e Mon Sep 17 00:00:00 2001 From: vdutta Date: Wed, 27 Jan 2021 19:37:40 +0530 Subject: [PATCH] obuspa: Reload when schema update available --- obuspa/Makefile | 2 +- obuspa/files/etc/init.d/obuspa | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/obuspa/Makefile b/obuspa/Makefile index c04e93654..11d39f78e 100644 --- a/obuspa/Makefile +++ b/obuspa/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=obuspa -PKG_VERSION:=3.0.0.10 +PKG_VERSION:=3.0.0.11 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) diff --git a/obuspa/files/etc/init.d/obuspa b/obuspa/files/etc/init.d/obuspa index 208c124ba..6ae1bf4e4 100755 --- a/obuspa/files/etc/init.d/obuspa +++ b/obuspa/files/etc/init.d/obuspa @@ -530,6 +530,28 @@ service_triggers() { procd_add_reload_trigger "uspd" procd_add_config_trigger "config.change" "${CONFIGURATION}" /etc/init.d/obuspa remove_db + # Create a reload trigger if schema update avaialble + procd_open_trigger + json_add_array + json_add_string "" "usp.raw" + json_add_array + json_add_string "" "if" + json_add_array + json_add_string "" "eq" + json_add_string "" "action" + json_add_string "" "schema_update_available" + json_close_array + json_add_array + json_add_string "" "run_script" + json_add_string "" "/etc/init.d/obuspa" + json_add_string "" "reload" + json_close_array + json_close_array + json_add_int "" "1000" + json_close_array + procd_close_trigger + + # local interface # config_load obuspa # config_get interface global interface