Add a function to look at the system network interfaces and return the
first one it finds with an active link (if any.)
# XXX Do we need to reset the flags here? anaconda never bothered..
}
+find_iface_with_link() {
+ local iface_path="" iface=""
+ for iface_path in /sys/class/net/*; do
+ iface=${iface_path##*/}
+ str_starts "$iface" "lo" && continue
+ if iface_has_link $iface; then
+ echo "$iface"
+ return 0
+ fi
+ done
+ return 1
+}
+
all_ifaces_up() {
local iface="" IFACES=""
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces