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