summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2002-04-30 23:26:28 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2002-04-30 23:26:28 +0000
commit86f2bd33733331e6c7f97ea6bc2ff3aed9d40f56 (patch)
tree55286343ccc470da84297a2d67c152fdab9c5e9d /distrib
parent9530879db81f2169d931b9199b4e7bc7a080fc16 (diff)
Clean up configure_all_interfaces() a bit.
Always make the default answer the first unconfigured interface, and when there are no unconfigured interfaces make the default answer 'done'. As a result _reprompt would always be set to 1, so eliminate it and the if statement testing it.
Diffstat (limited to 'distrib')
-rw-r--r--distrib/miniroot/install.sub41
1 files changed, 16 insertions, 25 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 77bc4ee92cf..0e968d4eda1 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.216 2002/04/30 04:04:47 deraadt Exp $
+# $OpenBSD: install.sub,v 1.217 2002/04/30 23:26:27 krw Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2002 Todd Miller, Theo de Raadt, Ken Westerback
@@ -399,51 +399,42 @@ addifconfig() {
}
configure_all_interfaces() {
- local _ifsdone= _ifs _ouranswer= _reprompt=1
+ local _ifsdone _ifs _ouranswer
_IFS=`get_ifdevs`
- resp=
- while [ "$resp" != "done" ]; do
- if [ $_reprompt = 1 ]; then
- cat << __EOT
+ while : ; do
+ cat << __EOT
You may configure the following network interfaces (the interfaces
marked with [X] have been successfully configured):
__EOT
-
- for _ifs in $_IFS; do
+ _ouranswer=
+ for _ifs in $_IFS; do
+ if isin $_ifs $_ifsdone ; then
+ echo -n " [X] "
+ else
+ echo -n " [ ] "
: ${_ouranswer:=$_ifs}
- if isin $_ifs $_ifsdone ; then
- echo -n " [X] "
- else
- echo -n " [ ] "
- fi
- echo $_ifs
- done
- echo
- fi
- ask "Configure which interface? (or 'done')" "$_ouranswer"
+ fi
+ echo $_ifs
+ done
+ : ${_ouranswer:=done}
+ ask "\nConfigure which interface? (or 'done')" "$_ouranswer"
case $resp in
- "done") ;;
- "") _reprompt=0
+ "done") break
;;
*) _ifs=$resp
- _ouranswer=done
if isin $_ifs $_IFS ; then
if configure_ifs $_ifs ; then
_ifsdone="$_ifs $_ifsdone"
- else
- _ouranswer=
fi
else
echo "Invalid response: '$resp' is not in list"
fi
- _reprompt=1
;;
esac
-
done
}