Browse Source

Merge pull request #12594 from hnyman/nlbw

nlbwmon: add hotplug script to reload after interface ifup
lilik-openwrt-22.03
Hannu Nyman 4 years ago
committed by GitHub
parent
commit
6a547b60a3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions
  1. +4
    -2
      net/nlbwmon/Makefile
  2. +9
    -0
      net/nlbwmon/files/nlbwmon.hotplug

+ 4
- 2
net/nlbwmon/Makefile View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=nlbwmon
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/jow-/nlbwmon.git
@ -25,7 +25,7 @@ define Package/nlbwmon
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libubox +libnl-tiny +zlib +kmod-nf-conntrack-netlink
TITLE:=LEDE Traffic Usage Monitor
TITLE:=OpenWrt Traffic Usage Monitor
endef
define Package/nlbwmon/install
@ -38,6 +38,8 @@ define Package/nlbwmon/install
$(INSTALL_BIN) ./files/nlbwmon.init $(1)/etc/init.d/nlbwmon
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/nlbwmon.config $(1)/etc/config/nlbwmon
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/nlbwmon.hotplug $(1)/etc/hotplug.d/iface/30-nlbwmon
endef
define Package/nlbwmon/conffiles


+ 9
- 0
net/nlbwmon/files/nlbwmon.hotplug View File

@ -0,0 +1,9 @@
#!/bin/sh
[ -n "$DEVICE" ] || exit 0
[ "$ACTION" = ifup ] && /etc/init.d/nlbwmon enabled && {
/etc/init.d/nlbwmon reload
logger -t nlbwmon "Reloading nlbwmon due to $ACTION of $INTERFACE ($DEVICE)"
}

Loading…
Cancel
Save