From f4ccf9bd4f0ac33cf71a071a07e698bb7a0e7a60 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 13 Apr 2016 12:17:36 -0400 Subject: [PATCH] Set variable in Windows scripts to default value This commit sets the bad_env_var to a default value of 0 so that in case no bad environment variables are encountered the variable is still defined and does not later cause a parse error in the execution of these batch files. Relates #17675 --- distribution/src/main/resources/bin/elasticsearch.bat | 1 + distribution/src/main/resources/bin/service.bat | 1 + 2 files changed, 2 insertions(+) diff --git a/distribution/src/main/resources/bin/elasticsearch.bat b/distribution/src/main/resources/bin/elasticsearch.bat index e6bcc634452..3a9d561e2e3 100644 --- a/distribution/src/main/resources/bin/elasticsearch.bat +++ b/distribution/src/main/resources/bin/elasticsearch.bat @@ -6,6 +6,7 @@ TITLE Elasticsearch ${project.version} SET params='%*' rem TODO: remove for Elasticsearch 6.x +set bad_env_var=0 if not "%ES_MIN_MEM%" == "" set bad_env_var=1 if not "%ES_MAX_MEM%" == "" set bad_env_var=1 if not "%ES_HEAP_SIZE%" == "" set bad_env_var=1 diff --git a/distribution/src/main/resources/bin/service.bat b/distribution/src/main/resources/bin/service.bat index 2519550f4aa..3d73c37b823 100644 --- a/distribution/src/main/resources/bin/service.bat +++ b/distribution/src/main/resources/bin/service.bat @@ -4,6 +4,7 @@ SETLOCAL enabledelayedexpansion TITLE Elasticsearch Service ${project.version} rem TODO: remove for Elasticsearch 6.x +set bad_env_var=0 if not "%ES_MIN_MEM%" == "" set bad_env_var=1 if not "%ES_MAX_MEM%" == "" set bad_env_var=1 if not "%ES_HEAP_SIZE%" == "" set bad_env_var=1