mirror of
https://github.com/churchers/vm-bhyve.git
synced 2026-01-06 13:03:42 +01:00
Fix #147. Exit with message if grub-bhyve requested but not found
This commit is contained in:
13
lib/vm-core
13
lib/vm-core
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user