Fix source file, BASH_SROUCE did not work without the shebang. Also fix bug for when it sees .. and assumes current directory.

This commit is contained in:
2023-08-21 12:14:53 -07:00
parent 0451897610
commit 8d394cafd3
2 changed files with 10 additions and 2 deletions

View File

@@ -4,6 +4,10 @@
# in. Therefore a local DNS is necessary in order to tell Nextcloud that the # in. Therefore a local DNS is necessary in order to tell Nextcloud that the
# document server is a local IP address rather than the WAN address like an # document server is a local IP address rather than the WAN address like an
# external DNS would. # external DNS would.
# This file should be sourced by the shell instance starting the containers, it
# unfortunately cannot be specified in the env_file: element because the dns:
# element reads its variables before env_file: is loaded. Putting the servers
# into environment: works but then the configuration is no longer private.
# A private DNS server, such as one run by this project's Config/DNS/ config. # A private DNS server, such as one run by this project's Config/DNS/ config.
DNS1=10.110.1.53 DNS1=10.110.1.53

View File

@@ -1,9 +1,11 @@
#!/bin/bash
# Provide any necessary project variables. # Provide any necessary project variables.
# Needs run in the current shell environment, such as: # Needs run in the current shell environment, such as:
# source /PATH_TO_GIT_PROJECT/source.env # source /PATH_TO_PROJECT/source.env
DIR="$(dirname -- "${BASH_SOURCE[0]}")" DIR="$(dirname -- "${BASH_SOURCE[0]}")"
if [[ $DIR == \.* ]]; then if [[ "$DIR" == '.'* ]]; then
cd $DIR
DIR="`pwd`" DIR="`pwd`"
fi fi
@@ -12,3 +14,5 @@ DOCKER_PATH="$DOCKER_HOME/bin"
PATH="$DOCKER_PATH:$PATH" PATH="$DOCKER_PATH:$PATH"
export DOCKER_HOME DOCKER_PATH PATH export DOCKER_HOME DOCKER_PATH PATH
source $DIR/dns.env