summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-28 19:12:55 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-28 19:12:55 -0300
commit2ce49691634a67397a198ecfb0ba6e1668d05d3d (patch)
tree0a6e83737bf7f70b295c9b8691f03a400095cb2f /lib
parent2f0950268393d8eb73ec647edb09d8c90f4ae079 (diff)
downloadhydra-2ce49691634a67397a198ecfb0ba6e1668d05d3d.tar.gz
hydra-2ce49691634a67397a198ecfb0ba6e1668d05d3d.tar.bz2
Checking availability of commands
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index 5b34214..98d16ac 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -45,3 +45,15 @@ function hydra_truncate_database {
mysql $1 -e "drop database $1; create database $1;"
fi
}
+
+# Check for a command
+function hydra_check_command {
+ if [ -z "$1" ]; then
+ return
+ fi
+
+ if ! which $1 &> /dev/null; then
+ echo "Please install a package for $1 to run this action"
+ exit 1
+ fi
+}