aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-06-23 09:53:54 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-06-23 09:53:54 -0300
commitc94472dc0e24d234eb8e135cfcc4029018072dc3 (patch)
tree7f0f25257e4da4d5c82ea1c74f98a41fea81153e /lib
parent23e5ab8db41d37ae70a226fc5446dc9ba51a26bc (diff)
downloadkvmx-c94472dc0e24d234eb8e135cfcc4029018072dc3.tar.gz
kvmx-c94472dc0e24d234eb8e135cfcc4029018072dc3.tar.bz2
Check for requirements and use spicy as default spice_client
Diffstat (limited to 'lib')
-rwxr-xr-xlib/kvmx/functions14
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
+}