From 440fd2954773f310597e9508d9fc931afee998dc Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 6 May 2011 23:21:45 -0300 Subject: Checking for dependencies at provision action --- lib/hydra/misc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib') diff --git a/lib/hydra/misc b/lib/hydra/misc index 2fd5518..6f74f8a 100644 --- a/lib/hydra/misc +++ b/lib/hydra/misc @@ -24,3 +24,16 @@ function hydra_user_input { export $param=$input fi } + +# Install a package. +function hydra_install_package { + if [ -z "$1" ]; then + return + fi + + dpkg -l $1 &> /dev/null + + if [ "$?" == "1" ]; then + apt-get install $1 + fi +} -- cgit v1.2.3