Browse Source

Merge pull request #4173 from TDT-GmbH/mwan-change-hotplug

net/mwan3: pass environment variables to mwan3-user
lilik-openwrt-22.03
Hannu Nyman 7 years ago
committed by GitHub
parent
commit
0cb126fd6d
2 changed files with 8 additions and 6 deletions
  1. +3
    -2
      net/mwan3/files/etc/hotplug.d/iface/16-mwan3-user
  2. +5
    -4
      net/mwan3/files/etc/mwan3.user

+ 3
- 2
net/mwan3/files/etc/hotplug.d/iface/16-mwan3-user View File

@ -4,9 +4,10 @@
. /lib/functions.sh
config_load mwan3
config_get enabled $INTERFACE enabled 0
config_get enabled "$INTERFACE" enabled 0
[ "${enabled}" = "1" ] || exit 0
/bin/sh /etc/mwan3.user $ACTION $INTERFACE $DEVICE
env -i ACTION="$ACTION" INTERFACE="$INTERFACE" DEVICE="$DEVICE" \
/bin/sh /etc/mwan3.user
}
exit 0

+ 5
- 4
net/mwan3/files/etc/mwan3.user View File

@ -5,7 +5,8 @@
# 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/...)
# There are three main environment variables that are passed to this script.
#
# $ACTION Either "ifup" or "ifdown"
# $INTERFACE Name of the interface which went up or down (e.g. "wan" or "wwan")
# $DEVICE Physical device name which interface went up or down (e.g. "eth0" or "wwan0")

Loading…
Cancel
Save