summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-05-06 23:21:45 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-05-06 23:21:45 -0300
commit440fd2954773f310597e9508d9fc931afee998dc (patch)
treef04bb7eb21f547b513112c284250ff9099221093 /lib
parent613707a83fcadac0f67dc89d2c5b7fda387d7855 (diff)
downloadhydra-440fd2954773f310597e9508d9fc931afee998dc.tar.gz
hydra-440fd2954773f310597e9508d9fc931afee998dc.tar.bz2
Checking for dependencies at provision action
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc13
1 files changed, 13 insertions, 0 deletions
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
+}