-# $OpenBSD: install.sub,v 1.790 2014/08/10 16:32:28 rpe Exp $
+# $OpenBSD: install.sub,v 1.791 2014/08/10 20:54:17 rpe Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
# All rights reserved.
mkdir -p $_cdir
rm -rf -- $_cdir/*
while read _l; do
- [ "$_l" ] || continue
+ [[ -n $_l ]] || continue
mkdir -p /tmp/cdir/"$_l"
_clist[${#_clist[*]}]="$_l"
done
done </tmp/fstab >/etc/fstab
# If no /etc/fstab was created, we have nowhere to $MODE to.
- if [ ! -s /etc/fstab ]; then
+ if [[ ! -s /etc/fstab ]]; then
echo "Unable to create valid /etc/fstab."
exit
fi
while read _dev _mp _fstype _opt _rest; do
# If not the root filesystem, make sure the mount
# point is present.
- [ "$_mp" = "/mnt" ] || mkdir -p $_mp
+ [[ $_mp == /mnt ]] || mkdir -p $_mp
# Mount the filesystem. Remember any failure.
_msg=$(mount -v -t $_fstype $_async -o $_opt $_dev $_mp) ||
while read _dev _mp _fstype _rest _rest _passno _rest; do
_dn=$(getdevname "$_dev")
[[ $ROOTDEV == @(${_dev#/dev/}|$_dn${_dev##*.}) ]] && continue
- [ -f "/sbin/fsck_$_fstype" ] || continue
+ [[ -f /sbin/fsck_$_fstype ]] || continue
# Make sure device exists before fsck'ing it.
makedev "$_dn" || continue
((_passno > 0)) || continue
fi
done </etc/fstab
- [ "$_fail" ] && exit
+ [[ -n $_fail ]] && exit
}
# Extract fully qualified domain name from current hostname. If none is
# so it will eventually be copied to /mnt/etc/resolv.conf and will
# not in the meantime remove the user's ability to choose to use it
# or not, during the rest of the install.
- if [ -f /tmp/resolv.conf.shadow ]; then
+ if [[ -f /tmp/resolv.conf.shadow ]]; then
mv /tmp/resolv.conf.shadow /tmp/resolv.conf
# Get nameserver address(es). Store as a blank separated list.
for _n in $(grep '^nameserver ' /tmp/resolv.conf); do
# dynamic. That is highly discouraged, but let us play it safe.
rm -f /mnt/var/run/ld.so.hints
- [ -x /mnt/$MODE.site ] && /mnt/usr/sbin/chroot /mnt /$MODE.site
+ [[ -x /mnt/$MODE.site ]] && /mnt/usr/sbin/chroot /mnt /$MODE.site
# In case this is a softraid device, make sure all underlying
# device nodes exist.