From: Silvio Rhatto Date: Sat, 7 May 2011 02:33:10 +0000 (-0300) Subject: Install package based on command name X-Git-Tag: 0.1~342 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=a06184080bb791c5251d301f1dd3ae951e1b5e19;p=hydra.git Install package based on command name --- diff --git a/lib/hydra/misc b/lib/hydra/misc index 62fd7f5..6bd0c61 100644 --- a/lib/hydra/misc +++ b/lib/hydra/misc @@ -25,13 +25,13 @@ function hydra_user_input { fi } -# Install a package. +# Install a package based on command name. function hydra_install_package { if [ -z "$1" ]; then return fi - dpkg -l $1 &> /dev/null + which $1 &> /dev/null if [ "$?" == "1" ]; then apt-get install $1 -y