diff --git a/distribution/src/main/resources/bin/elasticsearch-plugin b/distribution/src/main/resources/bin/elasticsearch-plugin index 06f8c5b8c27..098d9124498 100755 --- a/distribution/src/main/resources/bin/elasticsearch-plugin +++ b/distribution/src/main/resources/bin/elasticsearch-plugin @@ -82,9 +82,10 @@ HOSTNAME=`hostname | cut -d. -f1` export HOSTNAME declare -a args=("$@") +path_props=(-Des.path.home="$ES_HOME") if [ -e "$CONF_DIR" ]; then - args=("${args[@]}" -Edefault.path.conf="$CONF_DIR") + path_props=("${path_props[@]}" -Des.path.conf="$CONF_DIR") fi -exec "$JAVA" $ES_JAVA_OPTS -Delasticsearch -Des.path.home="$ES_HOME" -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginCli "${args[@]}" +exec "$JAVA" $ES_JAVA_OPTS -Delasticsearch "${path_props[@]}" -cp "$ES_HOME/lib/*" org.elasticsearch.plugins.PluginCli "${args[@]}" diff --git a/distribution/src/main/resources/bin/elasticsearch-plugin.bat b/distribution/src/main/resources/bin/elasticsearch-plugin.bat index 54c0b86b880..58b749d6b83 100644 --- a/distribution/src/main/resources/bin/elasticsearch-plugin.bat +++ b/distribution/src/main/resources/bin/elasticsearch-plugin.bat @@ -17,9 +17,14 @@ for %%I in ("%SCRIPT_DIR%..") do set ES_HOME=%%~dpfI TITLE Elasticsearch Plugin Manager ${project.version} +SET path_props=-Des.path.home="%ES_HOME%" +IF DEFINED CONF_DIR ( + SET path_props=!path_props! -Des.path.conf="%CONF_DIR%" +) + SET args=%* SET HOSTNAME=%COMPUTERNAME% -"%JAVA%" %ES_JAVA_OPTS% -Des.path.home="%ES_HOME%" -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginCli" !args! +"%JAVA%" %ES_JAVA_OPTS% !path_props! -cp "%ES_HOME%/lib/*;" "org.elasticsearch.plugins.PluginCli" !args! ENDLOCAL