Browse Source

net/mwan3: add mwan3.user hotplug script

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
lilik-openwrt-22.03
Florian Eckert 7 years ago
parent
commit
43ca6ec481
3 changed files with 25 additions and 1 deletions
  1. +2
    -1
      net/mwan3/Makefile
  2. +12
    -0
      net/mwan3/files/etc/hotplug.d/iface/16-mwan3-user
  3. +11
    -0
      net/mwan3/files/etc/mwan3.user

+ 2
- 1
net/mwan3/Makefile View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
PKG_VERSION:=2.1
PKG_VERSION:=2.2
PKG_RELEASE:=4
PKG_MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>, \
Florian Eckert <fe@dev.tdt.de>
@ -35,6 +35,7 @@ endef
define Package/mwan3/conffiles
/etc/config/mwan3
/etc/mwan3.user
endef
define Build/Compile


+ 12
- 0
net/mwan3/files/etc/hotplug.d/iface/16-mwan3-user View File

@ -0,0 +1,12 @@
#!/bin/sh
[ -f "/etc/mwan3.user" ] && {
. /lib/functions.sh
config_load mwan3
config_get enabled $INTERFACE enabled 0
[ "${enabled}" = "1" ] || exit 0
/bin/sh /etc/mwan3.user $ACTION $INTERFACE $DEVICE
}
exit 0

+ 11
- 0
net/mwan3/files/etc/mwan3.user View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# This file is interpreted as shell script.
# Put your custom mwan3 action here, they will
# be executed with each netifd hotplug interface event
# on interfaces for which mwan3 is enabled.
#
# Parameter values from hotplug.d
# $1 = ACTION (ifup/ifdown)
# $2 = INTERFACE (wan/lan/...)
# $3 = DEVICE (eth0/wwan0/...)

Loading…
Cancel
Save