ACCUMULO-4445 Fix broken bin/accumulo script

More strictly check that the first argument is a tserver-NNNN pattern
before setting up INSTANCE_OPTS for multiple tablet servers. This fixes
breakage of other commands which simply include a dash(-) character.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ebd42e2a
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ebd42e2a
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ebd42e2a

Branch: refs/heads/master
Commit: ebd42e2abb6a591a6806adebd60f2a59dd160621
Parents: a4afd1b
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Thu Sep 1 16:22:15 2016 -0400
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Thu Sep 1 16:22:15 2016 -0400

----------------------------------------------------------------------
 assemble/bin/accumulo | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ebd42e2a/assemble/bin/accumulo
----------------------------------------------------------------------
diff --git a/assemble/bin/accumulo b/assemble/bin/accumulo
index c26e704..a0fc17b 100755
--- a/assemble/bin/accumulo
+++ b/assemble/bin/accumulo
@@ -158,10 +158,10 @@ APP=$1
 INSTANCE=""
 # Avoid setting a pointless system property
 INSTANCE_OPT=""
-if [[ "$1" =~ .*-.* ]]; then
-  APP="$(echo $1 | cut -d'-' -f1)"
+if [[ "$1" =~ ^tserver-[1-9][0-9]*$ ]]; then
+  APP="$(echo "$1" | cut -d'-' -f1)"
   # Appending the trailing underscore to make single-tserver deploys look how 
they did
-  INSTANCE="$(echo $1 | cut -d'-' -f2)_"
+  INSTANCE="$(echo "$1" | cut -d'-' -f2)_"
 
   #Rewrite the input arguments
   set -- "$APP" "${@:2}"

Reply via email to