]> 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>
Thu, 10 Sep 2015 11:20:18 +0000 (13:20 +0200)
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.

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

index 9d22ec1c82c56fb0ab72f6d11dc4cdfae73dfe94..60d3579ad1dbb9d16a4e6c0f829f7febb969da75 100755 (executable)
@@ -74,6 +74,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