aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-05-12 16:20:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-05-12 16:20:42 -0300
commit238082d2fe4efa5b83153bba8681c3ad582a07ab (patch)
tree771df10af2b1129dc7ee29aa6ef45860b1c14f9a
parent7518602cddaaeb1b931a6b3a46505c427480c40e (diff)
downloadhydra-238082d2fe4efa5b83153bba8681c3ad582a07ab.tar.gz
hydra-238082d2fe4efa5b83153bba8681c3ad582a07ab.tar.bz2
Syntax check on hydras
-rwxr-xr-xhydras13
1 files changed, 12 insertions, 1 deletions
diff --git a/hydras b/hydras
index 2351316..6810898 100755
--- a/hydras
+++ b/hydras
@@ -21,20 +21,31 @@
# Basename configuration
BASENAME="`basename $0`"
-if [ -z "$1" ]; then
+function usage {
echo "usage: $BASENAME <hydra1> [<hydra2> ... <hydraN>] -- <command>"
+ exit 1
+}
+
+if [ -z "$1" ]; then
+ usage
fi
for param in $*; do
shift
if [ "$param" == "--" ]; then
+ has_delimiter="1"
break
fi
hydras="$hydras $param"
done
+if [ -z "$has_delimiter" ]; then
+ echo "missing command delimiter --"
+ usage
+fi
+
for hydra in $hydras; do
echo "Issuing $* on hydra $hydra..."
hydra $hydra $*