With this change it is now possible to combine interface action events. If an interface action is generated by netifd or mwan3 for example ifup, ifdown, connectd or disconnected and this action is configured in the inteface uci section, then the conntrack table is flushed by mwan3. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
22 lines
424 B
Bash
22 lines
424 B
Bash
#!/bin/sh
|
|
|
|
. /lib/functions.sh
|
|
. /lib/functions/network.sh
|
|
. /lib/mwan3/mwan3.sh
|
|
|
|
config_load mwan3
|
|
config_get_bool enabled globals 'enabled' '0'
|
|
[ ${enabled} -gt 0 ] || exit 0
|
|
|
|
if [ "$ACTION" == "ifup" ]; then
|
|
mwan3_lock "$ACTION" "mwan3rtmon"
|
|
mwan3_rtmon
|
|
mwan3_unlock "$ACTION" "mwan3rtmon"
|
|
fi
|
|
|
|
config_get enabled $INTERFACE enabled 0
|
|
[ "${enabled}" = "0" ] || {
|
|
mwan3_flush_conntrack "$INTERFACE" "$ACTION"
|
|
}
|
|
|
|
exit 0
|