From 1d6f4ffca24d661f65cd4f594b986387506313ec Mon Sep 17 00:00:00 2001 From: Ryan Stewart Date: Mon, 25 Jul 2022 15:21:31 -0500 Subject: [PATCH] make init-es.sh work outside bash Many Docker images are built on lightweight linux distros that don't include bash. The eclipse-temurin image that provides a JDK is one example. To run a script like this on that kind of image, it can't use any exclusive bash-isms. The script just has one, small issue: it uses the `BASH_SOURCE` env variable. An almost identical replacement for `${BASH_SOURCE[0]}` is `$0`, and it should work fine for us. For further details see https://stackoverflow.com/a/35006505. --- blueflood-elasticsearch/src/main/resources/init-es.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueflood-elasticsearch/src/main/resources/init-es.sh b/blueflood-elasticsearch/src/main/resources/init-es.sh index aa8557058..5ebf16628 100755 --- a/blueflood-elasticsearch/src/main/resources/init-es.sh +++ b/blueflood-elasticsearch/src/main/resources/init-es.sh @@ -33,7 +33,7 @@ if [ $ES_USERNAME ] && [ $ES_PASSWD ]; then fi # Using this in the checkfile function allows us to run this script from any directory -ABSOLUTE_PATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd) +ABSOLUTE_PATH=$(cd `dirname "$0"` && pwd) function checkFile { echo checking $1.