mirror of
https://github.com/opnsense/src.git
synced 2026-06-05 06:42:56 -04:00
bsdinstall: Fail nicely in jail target
If the directory is empty we fail with a message regarding mkdir in which the empty directory can't be seen because it is not quoted. Show a nice message so the user knows what is going on. Reviewed by: bapt@ Differential Revision: https://reviews.freebsd.org/D42252
This commit is contained in:
parent
ef1dad6d83
commit
b9cf989234
1 changed files with 5 additions and 1 deletions
|
|
@ -36,7 +36,6 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
|
|||
: ${BSDDIALOG_OK=0}
|
||||
|
||||
f_dprintf "Began Installation at %s" "$( date )"
|
||||
export BSDINSTALL_CHROOT=$1
|
||||
|
||||
error() {
|
||||
local msg
|
||||
|
|
@ -54,6 +53,11 @@ error() {
|
|||
fi
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
error "Directory can not be empty\n\nUsage:\nbsdinstall jail directory"
|
||||
fi
|
||||
export BSDINSTALL_CHROOT=$1
|
||||
|
||||
rm -rf $BSDINSTALL_TMPETC
|
||||
mkdir $BSDINSTALL_TMPETC
|
||||
mkdir -p $1 || error "mkdir failed for $1"
|
||||
|
|
|
|||
Loading…
Reference in a new issue