]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: add all_ifaces_setup()
authorHarald Hoyer <harald@redhat.com>
Thu, 10 Sep 2015 11:20:18 +0000 (13:20 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 11 Nov 2015 15:44:13 +0000 (16:44 +0100)
all_ifaces_up() is true, if all interfaces are up.

all_ifaces_setup() is true, if all interfaces are up and the gateways
and nameserver are setup.

(cherry picked from commit 63e75dc4cdb14e392e38a8973126c9a29b266411)

modules.d/40network/net-lib.sh

index 80964813b70111615a088a1a35e63468cc1d3c34..706a9a5644dd6e99a98a5498e550ce16ff4c1f20 100755 (executable)
@@ -73,6 +73,14 @@ all_ifaces_up() {
     done
 }
 
+all_ifaces_setup() {
+    local iface="" IFACES=""
+    [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
+    for iface in $IFACES; do
+        [ -e /tmp/net.$iface.did-setup ] || return 1
+    done
+}
+
 get_netroot_ip() {
     local prefix="" server="" rest=""
     splitsep "$1" ":" prefix server rest