From 42dab25a22b51e2f6352c24210a39ea37ecee0fe Mon Sep 17 00:00:00 2001
From: nwhitehorn <nwhitehorn@FreeBSD.org>
Date: Tue, 25 Oct 2011 16:35:48 +0000
Subject: [PATCH] Provide an error message and error handling if there are no
 network interfaces in the system. This is a non-fatal error except when doing
 a network installation.

PR:		bin/161950
MFC after:	3 days
---
 usr.sbin/bsdinstall/scripts/netconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig
index e0f390c27876..382ff2ce4734 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig
+++ b/usr.sbin/bsdinstall/scripts/netconfig
@@ -49,6 +49,13 @@ for IF in `ifconfig -l`; do
 	DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\""
 done
 
+if [ -z "$INTERFACES" ]; then
+	dialog --backtitle 'FreeBSD Installer' \
+	    --title 'Network Configuration Error' \
+	    --msgbox 'No network interfaces present to configure.' 0 0
+	exit 1
+fi
+
 exec 3>&1
 INTERFACE=`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&3`
 if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi