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

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