diff options
author | 2002-04-30 23:26:27 +0000 | |
---|---|---|
committer | 2002-04-30 23:26:27 +0000 | |
commit | 92b5d1e66285b0027dc98c5b933a0a8d81663191 (patch) | |
tree | 74c0be7d693c1c5274239915d46c3572a444c455 | |
parent | Do signal regress tests (diff) | |
download | wireguard-openbsd-92b5d1e66285b0027dc98c5b933a0a8d81663191.tar.xz wireguard-openbsd-92b5d1e66285b0027dc98c5b933a0a8d81663191.zip |
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.
-rw-r--r-- | distrib/miniroot/install.sub | 41 |
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 } |