diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2004-10-02 18:45:09 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2004-10-02 18:45:09 +0000 |
commit | f8f55c2a3fe980a887bea1cb7d4ecca013be014d (patch) | |
tree | 5319a5998874b19cd03d7932f5d79a380872a9f1 /distrib/miniroot | |
parent | d9b8d65f6172290e4227d18ee8361a26198b8813 (diff) |
Minor code cleanup and shrinkage. No functional change.
Diffstat (limited to 'distrib/miniroot')
-rw-r--r-- | distrib/miniroot/install.sh | 12 | ||||
-rw-r--r-- | distrib/miniroot/install.sub | 10 | ||||
-rw-r--r-- | distrib/miniroot/upgrade.sh | 12 |
3 files changed, 14 insertions, 20 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index 42f374e8ffc..a2b7cdb1346 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sh,v 1.147 2004/07/30 00:16:30 krw Exp $ +# $OpenBSD: install.sh,v 1.148 2004/10/02 18:45:08 krw Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1997-2004 Todd Miller, Theo de Raadt, Ken Westerback @@ -339,16 +339,14 @@ ask_yn "Configure the network?" yes _oifs=$IFS IFS= -resp= -while [[ -z $resp ]]; do +while :; do askpass "Password for root account? (will not echo)" _password=$resp askpass "Password for root account? (again)" - if [ "$_password" != "$resp" ]; then - echo "Passwords do not match, try again." - resp= - fi + [[ $resp == $_password ]] && break + + echo "Passwords do not match, try again." done IFS=$_oifs diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index a7e94c1f7fe..5447a55426d 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.353 2004/09/29 00:05:14 krw Exp $ +# $OpenBSD: install.sub,v 1.354 2004/10/02 18:45:08 krw Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1997-2004 Todd Miller, Theo de Raadt, Ken Westerback @@ -1658,11 +1658,9 @@ for _set in base etc misc comp man game xbase xetc xshare xfont xserv site ; do done # decide upon an editor -if [ -z "$EDITOR" ] ; then - EDITOR=ed - [ -x /usr/bin/vi ] && EDITOR=vi - export EDITOR -fi +: ${EDITOR:=ed} +[[ -x /usr/bin/vi ]] && EDITOR=vi +export EDITOR # umount all filesystems, just in case we are re-running install or upgrade. [[ -f /etc/fstab ]] && umount -av 1>/dev/null 2>&1 diff --git a/distrib/miniroot/upgrade.sh b/distrib/miniroot/upgrade.sh index ba336ec77d9..e09ff80aa70 100644 --- a/distrib/miniroot/upgrade.sh +++ b/distrib/miniroot/upgrade.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: upgrade.sh,v 1.58 2004/07/30 00:16:30 krw Exp $ +# $OpenBSD: upgrade.sh,v 1.59 2004/10/02 18:45:08 krw Exp $ # $NetBSD: upgrade.sh,v 1.2.4.5 1996/08/27 18:15:08 gwr Exp $ # # Copyright (c) 1997-2004 Todd Miller, Theo de Raadt, Ken Westerback @@ -51,14 +51,12 @@ MODE=upgrade . install.sub # Have the user confirm that $ROOTDEV is the root filesystem. -resp= -while [ -z "$resp" ]; do +while :; do ask "Root filesystem?" "$ROOTDEV" resp=${resp##*/} - if [ ! -b /dev/$resp ]; then - echo "Sorry, ${resp} is not a block device." - resp= - fi + [[ -b /dev/$resp ]] && break + + echo "Sorry, $resp is not a block device." done ROOTDEV=$resp |