summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordyoung@redhat.com <dyoung@redhat.com>2012-12-12 12:23:22 +0800
committerHarald Hoyer <harald@redhat.com>2012-12-14 09:08:59 +0100
commitb455451f49cdcf0b48b3c8c5f5d81754fc259011 (patch)
tree2354f664c3a0dfaac969b659afbe8639efbe5300
parentefa5eb424dcf5a64fa6365850a07e4068a6b4309 (diff)
downloaddracut-b455451f49cdcf0b48b3c8c5f5d81754fc259011.tar.gz
dracut-b455451f49cdcf0b48b3c8c5f5d81754fc259011.tar.bz2
dracut-b455451f49cdcf0b48b3c8c5f5d81754fc259011.zip
Add function linkup
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>
-rw-r--r--modules.d/40network/net-lib.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
index 8bab2b60..142aa687 100644
--- a/modules.d/40network/net-lib.sh
+++ b/modules.d/40network/net-lib.sh
@@ -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
+}
+