#!/bin/ksh
-# $OpenBSD: install.sh,v 1.246 2014/03/20 20:01:28 krw Exp $
+# $OpenBSD: install.sh,v 1.247 2014/04/19 16:50:52 rpe Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
# Remove traces of previous install attempt.
rm -f /tmp/fstab*
-ask_yn "Use DUIDs rather than device names in fstab?" yes
-[[ $resp == y ]] && FSTABFLAG=-F
+ask_yn "Use DUIDs rather than device names in fstab?" yes && FSTABFLAG=-F
while :; do
DISKS_DONE=$(addel "$DISK" $DISKS_DONE)
if _time=$(http_time) && _now=$(date +%s) &&
(( _now - _time > 120 || _time - _now > 120 )); then
_tz=/mnt/usr/share/zoneinfo/$TZ
- ask_yn "Time appears wrong. Set to '$(TZ=$_tz date -r "$(http_time)")'?" yes
- if [[ $resp == y ]]; then
+ if ask_yn "Time appears wrong. Set to '$(TZ=$_tz date -r "$(http_time)")'?" yes; then
# We do not need to specify TZ below since both date
# invocations use the same one
date $(date -r "$(http_time)" "+%Y%m%d%H%M.%S") >/dev/null
-# $OpenBSD: install.sub,v 1.759 2014/04/16 13:12:22 krw Exp $
+# $OpenBSD: install.sub,v 1.760 2014/04/19 16:50:52 rpe Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
# All rights reserved.
}
install_disk() {
- ask_yn "Is the disk partition already mounted?"
- if [[ $resp == n ]]; then
+ if ! ask_yn "Is the disk partition already mounted?"; then
get_drive "disk" '$(bsort $(get_dkdevs))' \
'$(bsort $(rmel $ROOTDISK $(get_dkdevs)))' || return
mount_mnt2 $resp || return
NFS_PATH=$resp
# Determine use of TCP
- ask_yn "Use TCP transport? (requires TCP-capable NFS server)"
- [[ $resp == y ]] && _tcp=-T
+ ask_yn "Use TCP transport? (requires TCP-capable NFS server)" && _tcp=-T
# Mount the server
mount_nfs $_tcp -o ro -R 5 $NFS_ADDR:$NFS_PATH /mnt2 || return
if [[ -n $_fail ]]; then
# One or more mounts failed. Continue or abort?
echo "\nWARNING! The following filesystems were not properly mounted:$_fail"
- ask_yn "Continue anyway?" no
- if [[ $resp == n ]]; then
- exit
- fi
+ ask_yn "Continue anyway?" || exit
fi
}
check_fs() {
local _dev _dn _mp _fstype _rest _fail _f _passno
- ask_yn "Force checking of clean non-root filesystems?"
- [[ $resp == y ]] && _f=f
+ ask_yn "Force checking of clean non-root filesystems?" && _f=f
while read _dev _mp _fstype _rest _rest _passno _rest; do
_dn=$(getdevname "$_dev")