bsdinstall: record DHCP config after obtaining lease

Previously we added an ifconfig_$INTERFACE line to rc.conf for each
unsuccessful DCHP attempt.

PR:		219515
Reviewed by:	allanjude
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D11967
This commit is contained in:
Ed Maste 2017-08-10 20:26:07 +00:00
parent c89cfb4377
commit a230b8a753
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=322374

View File

@ -48,8 +48,6 @@ esac
dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0
if [ $? -eq $DIALOG_OK ]; then
echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> $BSDINSTALL_TMPETC/._rc.conf.net
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring DHCP lease..." 0 0
err=$( dhclient $INTERFACE 2>&1 )
@ -59,6 +57,7 @@ if [ $? -eq $DIALOG_OK ]; then
exec $0 ${INTERFACE} "${IFCONFIG_PREFIX}"
fi
fi
echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> $BSDINSTALL_TMPETC/._rc.conf.net
exit 0
fi