summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2018-11-05 18:01:50 +0000
committerJo-Philipp Wich <jo@mein.io>2019-06-06 09:33:54 +0200
commit486418e56c5c6bea2f1d5981a948e20c50935cbd (patch)
tree42d73020252f581d3dbc3c631af7617592dbe0b9
parent9a374b7d497c8a2295a0b3bcc36a83d7c74d2b29 (diff)
nlbwmon: receive dhcp interface triggers
Not all interfaces may have been allocated address at nlbwmon startup so it may not collect statistics as expected/configured. Add interface triggers to catch dhcp events and restart as required. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> (cherry picked from commit 662d3f16d2702fe55116c852f5d456e90891ee89)
-rw-r--r--net/nlbwmon/Makefile2
-rwxr-xr-xnet/nlbwmon/files/nlbwmon.init16
2 files changed, 17 insertions, 1 deletions
diff --git a/net/nlbwmon/Makefile b/net/nlbwmon/Makefile
index c8ce443cc..c20998e22 100644
--- a/net/nlbwmon/Makefile
+++ b/net/nlbwmon/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=nlbwmon
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jow-/nlbwmon.git
diff --git a/net/nlbwmon/files/nlbwmon.init b/net/nlbwmon/files/nlbwmon.init
index 53167dc65..15ab5a118 100755
--- a/net/nlbwmon/files/nlbwmon.init
+++ b/net/nlbwmon/files/nlbwmon.init
@@ -89,3 +89,19 @@ start_service() {
procd_close_instance
}
+add_interface_trigger() {
+ local interface ignore
+
+ config_get interface "$1" interface
+ config_get_bool ignore "$1" ignore 0
+
+ [ -n "$interface" -a $ignore -eq 0 ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/nlbwmon reload
+}
+
+service_triggers() {
+ procd_add_reload_trigger "dhcp" "system"
+
+ config_load dhcp
+ config_foreach add_interface_trigger dhcp
+}
+