arch-chroot: fix braino, check for args before shifting

This commit is contained in:
Dave Reisner 2016-06-12 10:51:04 -04:00
parent daa2fac5b2
commit bd413f05ce

View File

@ -62,10 +62,10 @@ done
shift $(( OPTIND - 1 ))
(( EUID == 0 )) || die 'This script must be run with root privileges'
(( $# )) || die 'No chroot directory specified'
chrootdir=$1
shift
(( $# )) || die 'No chroot directory specified'
[[ -d $chrootdir ]] || die "Can't create chroot on non-directory %s" "$chrootdir"
chroot_setup "$chrootdir" || die "failed to setup chroot %s" "$chrootdir"