Rework the location where spantree sleeps so that it happens after link is up
Jason D. Clinton [Fri, 5 Feb 2010 23:17:37 +0000 (17:17 -0600)]
etc/hardware.sh

index 0e417b1..c5dfac2 100755 (executable)
@@ -30,12 +30,16 @@ dhcp_on_interface() {
                return 1
        fi
 
-       msg -n "Trying DHCP on ${i} interface"
-
        # work around Cisco portfast implementation not being fast
-       /sbin/ifconfig ${i} up
+       /bin/ip link set dev ${i} up
 
-       sleep 1
+       if [ "${spantree}" != "" ]
+       then
+               msg "Sleeping for ${spantree} seconds for spanning tree"
+               sleep ${spantree}
+       fi
+
+       msg -n "Trying DHCP on ${i} interface"
 
        /sbin/udhcpc -i ${INTERFACE} -n -s /etc/ifup.udhcp.sh \
                -p /tmp/dhcp.${INTERFACE}.pid >> /tmp/stdout.log 2>> /tmp/stderr.log
@@ -61,12 +65,6 @@ done
 
 header "Finding ethernet devices"
 
-if [ "${spantree}" != "" ]
-then
-       msg "Sleeping for ${spantree} seconds for spanning tree"
-       sleep ${spantree}
-fi
-
 
 NET_DEVICES=`/sbin/ifconfig -a | grep "^[a-z]" | cut -d" " -f1`
 NET_DEVICE_COUNT=0