summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdinstall/scripts/netconfig_ipv4
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-06-02 14:25:27 +0000
committerbz <bz@FreeBSD.org>2011-06-02 14:25:27 +0000
commit6bfe728b8a801ef9b10237191abd76c6267a797c (patch)
tree78dcc79bb6907d5adea2aeff3eb5a6d6d7cec0b4 /usr.sbin/bsdinstall/scripts/netconfig_ipv4
parent04c4ecf8806ec0ea1e044eef7ffd0daa9a6912f4 (diff)
downloadFreeBSD-src-6bfe728b8a801ef9b10237191abd76c6267a797c.zip
FreeBSD-src-6bfe728b8a801ef9b10237191abd76c6267a797c.tar.gz
Write the multi step netconfig to a temporary file and only move that
to the final name if netconfig was completely finished. This fixes reentrance problems even better than r222611. Suggested by: nwhitehorn Reviewed by: nwhitehorn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems
Diffstat (limited to 'usr.sbin/bsdinstall/scripts/netconfig_ipv4')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/netconfig_ipv46
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
index dc6da7e..72dc0ee 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
@@ -44,7 +44,7 @@ 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
+ 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
@@ -74,10 +74,10 @@ echo $INTERFACE $IF_CONFIG |
awk -v prefix="$IFCONFIG_PREFIX" '{
printf("ifconfig_%s=\"%s inet %s netmask %s\"\n", $1, prefix, $2, $3);
printf("defaultrouter=\"%s\"\n", $4);
- }' >> $BSDINSTALL_TMPETC/rc.conf.net
+ }' >> $BSDINSTALL_TMPETC/._rc.conf.net
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
- . $BSDINSTALL_TMPETC/rc.conf.net
+ . $BSDINSTALL_TMPETC/._rc.conf.net
ifconfig $INTERFACE inet `eval echo \\\$ifconfig_$INTERFACE`
route delete -inet default
route add -inet default $defaultrouter
OpenPOWER on IntegriCloud