mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
net/mwan3: pass environment variables to mwan3-user
User scripts conversion from luci-app-wan3 will be simplified if the variables are passed by env instead of arguments. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
@@ -4,9 +4,10 @@
|
|||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
|
|
||||||
config_load mwan3
|
config_load mwan3
|
||||||
config_get enabled $INTERFACE enabled 0
|
config_get enabled "$INTERFACE" enabled 0
|
||||||
[ "${enabled}" = "1" ] || exit 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
|
exit 0
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
# be executed with each netifd hotplug interface event
|
# be executed with each netifd hotplug interface event
|
||||||
# on interfaces for which mwan3 is enabled.
|
# on interfaces for which mwan3 is enabled.
|
||||||
#
|
#
|
||||||
# Parameter values from hotplug.d
|
# There are three main environment variables that are passed to this script.
|
||||||
# $1 = ACTION (ifup/ifdown)
|
#
|
||||||
# $2 = INTERFACE (wan/lan/...)
|
# $ACTION Either "ifup" or "ifdown"
|
||||||
# $3 = DEVICE (eth0/wwan0/...)
|
# $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")
|
||||||
|
|||||||
Reference in New Issue
Block a user