Add function linkup
authordyoung@redhat.com <dyoung@redhat.com>
Wed, 12 Dec 2012 04:23:22 +0000 (12:23 +0800)
committerHarald Hoyer <harald@redhat.com>
Fri, 14 Dec 2012 08:08:59 +0000 (09:08 +0100)
set link up usually include two steps, ip link set <dev> up and
wait_for_if_up <dev>. Now do these two steps in one function linkup.
Later patch will add other code into it.

Signed-off-by: Dave Young <dyoung@redhat.com>
modules.d/40network/net-lib.sh

index 8bab2b6..142aa68 100644 (file)
@@ -345,3 +345,8 @@ wait_for_route_ok() {
     done
     return 1
 }
+
+linkup() {
+    ip link set $1 up 2>/dev/null && wait_for_if_up $1 2>/dev/null
+}
+