From 7d431ede6747eed8a42ee3e1fe28c05a60c4e1a8 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Sat, 17 Aug 2019 16:40:03 +0200 Subject: [PATCH] fix for #59 --- docker/my-dojo/dojo.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docker/my-dojo/dojo.sh b/docker/my-dojo/dojo.sh index beee1f09..d5f56209 100755 --- a/docker/my-dojo/dojo.sh +++ b/docker/my-dojo/dojo.sh @@ -6,18 +6,23 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" source_file() { if [ -f $1 ]; then source $1 + elif [ -f "$1.tpl" ]; then + source "$1.tpl" + else + echo "Unable to find file $1" fi } +# Source config files source_file "$DIR/conf/docker-bitcoind.conf" source_file "$DIR/conf/docker-common.conf" source_file "$DIR/.env" +# Export some variables for compose +export BITCOIND_RPC_EXTERNAL_IP # Select YAML files select_yaml_files() { - source_file "$DIR/conf/docker-bitcoind.conf" - yamlFiles="-f $DIR/docker-compose.yaml" if [ "$BITCOIND_INSTALL" == "on" ]; then @@ -25,7 +30,6 @@ select_yaml_files() { if [ "$BITCOIND_RPC_EXTERNAL" == "on" ]; then yamlFiles="$yamlFiles -f $DIR/overrides/bitcoind.rpc.expose.yaml" - export BITCOIND_RPC_EXTERNAL_IP fi fi @@ -151,6 +155,8 @@ upgrade() { yamlFiles=$(select_yaml_files) update_config_files cleanup + source_file "$DIR/conf/docker-bitcoind.conf" + export BITCOIND_RPC_EXTERNAL_IP eval "docker-compose $yamlFiles build --no-cache" docker_up --remove-orphans update_dojo_db