summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-04-19 21:42:01 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-04-19 21:42:01 +0000
commit29aff3399ac1323f329b8dbfb5bf43de93362774 (patch)
tree662cf11fd8647918dd901a4b637237443384c051
parentb361c78c1f214fea5c2ea715774769e56ed732de (diff)
When configuring the network assume the user means to assign
$(hostname -s) as the symbolic name of the first interface that is configured. Subsequent interfaces still get the question. Don't emit 'No more interfaces to initialize.'. Just move on to the rest of the network configuration. Use the word 'configure' rather than 'initialize'. Suggested by & ok deraadt@
-rw-r--r--distrib/miniroot/install.sub21
1 files changed, 11 insertions, 10 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 23a2d7adfc0..b7d5ddeac13 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.465 2009/04/19 17:56:01 deraadt Exp $
+# $OpenBSD: install.sub,v 1.466 2009/04/19 21:42:00 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2007 Todd Miller, Theo de Raadt, Ken Westerback
@@ -551,23 +551,24 @@ __EOT
configure_ifs() {
local _IFDEVS=$IFDEVS _ifs _name _hn
- while :; do
- ask_which "interface" "do you wish to initialize" "$_IFDEVS" \
- "" "No more interfaces to initialize"
+ while [[ -n $_IFDEVS ]]; do
+ ask_which "interface" "do you wish to configure" "$_IFDEVS"
[[ $resp == done ]] && break
_ifs=$resp
_hn=/tmp/hostname.$_ifs
+ rm -f $_hn
- # Get symbolic name - will be used in DHCP requests.
- ask "Symbolic (host) name for $_ifs?" "$(hostname -s)"
+ # First interface configured will use the hostname without
+ # asking the user.
+ resp=$(hostname -s)
+ [[ $_IFDEVS != $IFDEVS ]] && ask "Symbolic (host) name for $_ifs?" $resp
_name=$resp
- rm -f $_hn
- v4_config "$_ifs" "$_name" "$_hn"
- v6_config "$_ifs" "$_name" "$_hn"
+ v4_config $_ifs $_name $_hn
+ v6_config $_ifs $_name $_hn
- [[ -f $_hn ]] && chmod 640 $_hn && _IFDEVS=$(rmel "$_ifs" $_IFDEVS)
+ [[ -f $_hn ]] && chmod 640 $_hn && _IFDEVS=$(rmel $_ifs $_IFDEVS)
done
}