diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/kvmx/functions | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/kvmx/functions b/lib/kvmx/functions index 134f4be..d1a1015 100755 --- a/lib/kvmx/functions +++ b/lib/kvmx/functions @@ -19,3 +19,17 @@ function __kvmx_ssh_keygen { ssh-keygen -t rsa -b 4096 -f $1 -N '' -C $2 fi } + +# Check dependencies +function __kvmx_check_dependencies { + if [ -z "$DEPENDENCIES" ]; then + DEPENDENCIES="ssh sudo apt kvm virt-viewer spicy socat screen sed awk" + fi + + for dependency in $DEPENDENCIES; do + if ! which $dependency &> /dev/null; then + echo "$BASENAME: cannot find dependency program $dependency" + exit 1 + fi + done +} |