network: add all_ifaces_setup()

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 63e75dc4cd)
master
Harald Hoyer 2015-09-10 13:20:18 +02:00
parent e847a78bb6
commit 5d90ba4fca
1 changed files with 8 additions and 0 deletions

View File

@ -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