net/mwan3: also send connected action on initial_state offline
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 5 Apr 2018 11:15:18 +0000 (13:15 +0200)
committerYousong Zhou <yszhou4tech@gmail.com>
Sun, 8 Apr 2018 08:20:24 +0000 (16:20 +0800)
Move action into startup section will fix this.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/mwan3/files/usr/sbin/mwan3track

index fb72e99a3fdf4cc1bbdd28b421e833e00b600361..3593d11a438279557796f506cd5162cf1068543d 100755 (executable)
@@ -99,6 +99,7 @@ main() {
                score=0
        else
                echo "online" > /var/run/mwan3track/$1/STATUS
+               env -i ACTION="connected" INTERFACE="$1" DEVICE="$2" /sbin/hotplug-call iface
        fi
        while true; do
 
@@ -169,7 +170,6 @@ main() {
                        if [ $score -eq $up ]; then
                                $LOG notice "Interface $1 ($2) is online"
                                echo "online" > /var/run/mwan3track/$1/STATUS
-                               env -i ACTION="connected" INTERFACE="$1" DEVICE="$2" /sbin/hotplug-call iface
                                env -i ACTION=ifup INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
                                exit 0
                        fi