summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-06-11 02:28:50 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-06-11 02:28:50 +0000
commitf4f035112c19cf0df3d0246338f746a168fc3282 (patch)
treee3144b239fd7579dca42efecf2d0719292b8e81c /distrib
parentc6d6e0b95bd45dc2ff66b56f1a640f6dca74bd8d (diff)
Make 'dhcp' the default answer only if no other interface has
been configured to use dhcp. Requested by deraadt@.
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sub8
1 files changed, 6 insertions, 2 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 8d6d27189fa..cee8005a7cf 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.582 2009/06/10 07:03:29 deraadt Exp $
+# $OpenBSD: install.sub,v 1.583 2009/06/11 02:28:49 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -740,7 +740,11 @@ v4_config() {
fi
fi
- [[ -x /sbin/dhclient ]] && { _prompt="or 'dhcp' " ; : ${_addr:=dhcp} ; }
+ if [[ -x /sbin/dhclient ]]; then
+ _prompt="or 'dhcp' "
+ # Don't make 'dhcp' the default if dhcp was already used.
+ ifconfig dhcp >/dev/null 2>&1 || ${_addr:=dhcp}
+ fi
_prompt="IPv4 address for $_ifs? (${_prompt}or 'none')"
ask_until "$_prompt" "$_addr"