Blame SOURCES/0339-network-add-all_ifaces_setup.patch

64b87c
From 63e75dc4cdb14e392e38a8973126c9a29b266411 Mon Sep 17 00:00:00 2001
64b87c
From: Harald Hoyer <harald@redhat.com>
64b87c
Date: Thu, 10 Sep 2015 13:20:18 +0200
64b87c
Subject: [PATCH] network: add all_ifaces_setup()
64b87c
64b87c
all_ifaces_up() is true, if all interfaces are up.
64b87c
64b87c
all_ifaces_setup() is true, if all interfaces are up and the gateways
64b87c
and nameserver are setup.
64b87c
---
64b87c
 modules.d/40network/net-lib.sh | 8 ++++++++
64b87c
 1 file changed, 8 insertions(+)
64b87c
64b87c
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
1755ca
index 9d22ec1c..60d3579a 100755
64b87c
--- a/modules.d/40network/net-lib.sh
64b87c
+++ b/modules.d/40network/net-lib.sh
64b87c
@@ -74,6 +74,14 @@ all_ifaces_up() {
64b87c
     done
64b87c
 }
64b87c
 
64b87c
+all_ifaces_setup() {
64b87c
+    local iface="" IFACES=""
64b87c
+    [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
64b87c
+    for iface in $IFACES; do
64b87c
+        [ -e /tmp/net.$iface.did-setup ] || return 1
64b87c
+    done
64b87c
+}
64b87c
+
64b87c
 get_netroot_ip() {
64b87c
     local prefix="" server="" rest=""
64b87c
     splitsep "$1" ":" prefix server rest