mirror of
https://github.com/novatiq/packages.git
synced 2026-04-29 06:58:39 +01:00
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 662d3f16d2)
This commit is contained in:
committed by
Jo-Philipp Wich
parent
9a374b7d49
commit
486418e56c
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user