summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-01 14:17:59 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-01 14:17:59 -0200
commit69ba766373b5247cf28eb8aa4308ac679b1b5c71 (patch)
tree3f44fae3602c2df555309095ada9b41011bb1000 /share
parentb44f5147ebb4d06b9a2a3a0f85ff5b53a529ac98 (diff)
downloadhydra-69ba766373b5247cf28eb8aa4308ac679b1b5c71.tar.gz
hydra-69ba766373b5247cf28eb8aa4308ac679b1b5c71.tar.bz2
Fixing basic command line evaluation
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/register15
1 files changed, 9 insertions, 6 deletions
diff --git a/share/hydra/register b/share/hydra/register
index bf36540..677a73d 100755
--- a/share/hydra/register
+++ b/share/hydra/register
@@ -4,17 +4,20 @@
#
CONFIG="$HOME/.hydra/config"
-HYDRA="$1"
-BASEDIR="$2"
-PUPPET="$(dirname `find $BASEDIR -name puppet.conf`)"
+BASEDIR="$1"
-mkdir -p `dirname $CONFIG`
-
-if grep -q -e "^$HYDRA=" $CONFIG; then
+if [ -z "$BASEDIR" ]; then
+ echo "Usage: hydra [hydra] register <path>"
+ exit 1
+elif grep -q -e "^$HYDRA=" $CONFIG &> /dev/null; then
echo "Hydra $HYDRA already defined"
exit 1
fi
+# Folder setup
+#PUPPET="$(dirname `find $BASEDIR -name puppet.conf`)"
+mkdir -p `dirname $CONFIG`
+
# Reparse basedir to force absolute folder
BASEDIR="`cd $BASEDIR && pwd`"