From cb0f169655a019c6c2b262177288f4e146036027 Mon Sep 17 00:00:00 2001 From: jaymode Date: Fri, 11 Sep 2015 11:15:19 -0400 Subject: [PATCH] update CLI tools to work with spaces in the home path The CLI tools are launched by scripts and these scripts need to handle spaces in the elasticsearch home path. Closes elastic/elasticsearch#631 Original commit: elastic/x-pack-elasticsearch@6a4325d2967d7a556b455841d7c83a799f1f2489 --- shield/bin/shield/esusers | 4 ++-- shield/bin/shield/esusers.bat | 4 ++-- shield/bin/shield/syskeygen | 4 ++-- shield/bin/shield/syskeygen.bat | 4 ++-- watcher/bin/watcher/croneval | 4 ++-- watcher/bin/watcher/croneval.bat | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/shield/bin/shield/esusers b/shield/bin/shield/esusers index e0b953160ff..61c0553760d 100755 --- a/shield/bin/shield/esusers +++ b/shield/bin/shield/esusers @@ -32,7 +32,7 @@ if [ "x$ES_INCLUDE" = "x" ]; then /opt/elasticsearch/elasticsearch.in.sh \ ~/.elasticsearch.in.sh \ "`dirname "$0"`"/../elasticsearch.in.sh \ - $ES_HOME/bin/elasticsearch.in.sh; do + "$ES_HOME/bin/elasticsearch.in.sh"; do if [ -r "$include" ]; then . "$include" break @@ -125,7 +125,7 @@ export HOSTNAME=`hostname -s` # include shield jars in classpath ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/shield/*" -cd $ES_HOME > /dev/null +cd "$ES_HOME" > /dev/null "$JAVA" $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.shield.authc.esusers.tool.ESUsersTool "$@" status=$? cd - > /dev/null diff --git a/shield/bin/shield/esusers.bat b/shield/bin/shield/esusers.bat index d86e8722133..738f6b8b488 100644 --- a/shield/bin/shield/esusers.bat +++ b/shield/bin/shield/esusers.bat @@ -4,6 +4,6 @@ rem Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one rem or more contributor license agreements. Licensed under the Elastic License; rem you may not use this file except in compliance with the Elastic License. -PUSHD %~dp0 -CALL %~dp0.in.bat org.elasticsearch.shield.authc.esusers.tool.ESUsersTool %* +PUSHD "%~dp0" +CALL "%~dp0.in.bat" org.elasticsearch.shield.authc.esusers.tool.ESUsersTool %* POPD \ No newline at end of file diff --git a/shield/bin/shield/syskeygen b/shield/bin/shield/syskeygen index 6a314206f0d..726a729fc01 100755 --- a/shield/bin/shield/syskeygen +++ b/shield/bin/shield/syskeygen @@ -32,7 +32,7 @@ if [ "x$ES_INCLUDE" = "x" ]; then /opt/elasticsearch/elasticsearch.in.sh \ ~/.elasticsearch.in.sh \ "`dirname "$0"`"/../elasticsearch.in.sh \ - $ES_HOME/bin/elasticsearch.in.sh; do + "$ES_HOME/bin/elasticsearch.in.sh"; do if [ -r "$include" ]; then . "$include" break @@ -125,7 +125,7 @@ export HOSTNAME=`hostname -s` # include shield jars in classpath ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/shield/*" -cd $ES_HOME > /dev/null +cd "$ES_HOME" > /dev/null $JAVA $ES_JAVA_OPTS -cp "$ES_CLASSPATH" -Des.path.home="$ES_HOME" $properties org.elasticsearch.shield.crypto.tool.SystemKeyTool "$@" status=$? cd - > /dev/null diff --git a/shield/bin/shield/syskeygen.bat b/shield/bin/shield/syskeygen.bat index 7edacbc350a..5eccb21346d 100644 --- a/shield/bin/shield/syskeygen.bat +++ b/shield/bin/shield/syskeygen.bat @@ -4,6 +4,6 @@ rem Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one rem or more contributor license agreements. Licensed under the Elastic License; rem you may not use this file except in compliance with the Elastic License. -PUSHD %~dp0 -CALL %~dp0.in.bat org.elasticsearch.shield.crypto.tool.SystemKeyTool %* +PUSHD "%~dp0" +CALL "%~dp0.in.bat" org.elasticsearch.shield.crypto.tool.SystemKeyTool %* POPD \ No newline at end of file diff --git a/watcher/bin/watcher/croneval b/watcher/bin/watcher/croneval index 3a8c3fc30c7..418bbadcad9 100755 --- a/watcher/bin/watcher/croneval +++ b/watcher/bin/watcher/croneval @@ -32,7 +32,7 @@ if [ "x$ES_INCLUDE" = "x" ]; then /opt/elasticsearch/elasticsearch.in.sh \ ~/.elasticsearch.in.sh \ "`dirname "$0"`"/../elasticsearch.in.sh \ - $ES_HOME/bin/elasticsearch.in.sh; do + "$ES_HOME/bin/elasticsearch.in.sh"; do if [ -r "$include" ]; then . "$include" break @@ -116,7 +116,7 @@ export HOSTNAME=`hostname -s` # include watcher jars in classpath ES_CLASSPATH="$ES_CLASSPATH:$ES_HOME/plugins/watcher/*" -cd $ES_HOME > /dev/null +cd "$ES_HOME" > /dev/null $JAVA $ES_JAVA_OPTS -cp "$ES_CLASSPATH" org.elasticsearch.watcher.trigger.schedule.tool.CronEvalTool "$@" $properties status=$? cd - > /dev/null diff --git a/watcher/bin/watcher/croneval.bat b/watcher/bin/watcher/croneval.bat index 5506999712f..c78e7feca38 100644 --- a/watcher/bin/watcher/croneval.bat +++ b/watcher/bin/watcher/croneval.bat @@ -4,6 +4,6 @@ rem Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one rem or more contributor license agreements. Licensed under the Elastic License; rem you may not use this file except in compliance with the Elastic License. -PUSHD %~dp0 -CALL %~dp0.in.bat org.elasticsearch.watcher.trigger.schedule.tool.CronEvalTool %* +PUSHD "%~dp0" +CALL "%~dp0.in.bat" org.elasticsearch.watcher.trigger.schedule.tool.CronEvalTool %* POPD \ No newline at end of file