net/mwan3: move mwan3track clean up to mwan3 cmd

This is usefull to see the last state of the interface with ubus.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert
2017-07-24 10:20:46 +02:00
parent 96760e66dd
commit 5e123852bc
3 changed files with 22 additions and 7 deletions
-7
View File
@@ -10,12 +10,6 @@ IFDOWN_EVENT=0
clean_up() {
$LOG notice "Stopping mwan3track for interface \"${INTERFACE}\""
if [ "$(pgrep -f "mwan3track ${INTERFACE} ${DEVICE}")" = "" ]; then
rm -rf "/var/run/mwan3track/${INTERFACE}" &> /dev/null
fi
if [ -z "$(ls -A "/var/run/mwan3track")" ]; then
rm -rf "/var/run/mwan3track"
fi
exit 0
}
@@ -144,7 +138,6 @@ main() {
if [ $score -eq $up ]; then
$LOG notice "Interface $1 ($2) is online"
env -i ACTION=ifup INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
rm -rf "/var/run/mwan3track/${1}" &> /dev/null
exit 0
fi
fi