Fix #147. Exit with message if grub-bhyve requested but not found

This commit is contained in:
Matt Churchyard
2018-06-20 12:30:41 +00:00
parent cb600bcc22
commit 1dc6135cc9
2 changed files with 13 additions and 2 deletions

View File

@@ -390,7 +390,8 @@ core::start(){
core::__start(){
local _name="$1"
local _iso="$2"
local _cpu _memory _disk _guest _loader _console _tmux_cmd _tmux_name
local _cpu _memory _disk _guest _loader _console
local _tmux_cmd _tmux_name _util
[ -z "${_name}" ] && util::usage
@@ -429,6 +430,16 @@ core::__start(){
return 1
fi
# check loader
if [ "${_loader}" = "grub" ]; then
_util=$(which grub-bhyve)
if [ -z "${_util}" ]; then
echo " ! grub requested but sysutils/grub2-bhyve not installed?"
return 1
fi
fi
# check for tmux
config::core::get "_console" "console" "nmdm"
_tmux_cmd=$(which tmux)