Signed-off-by: Uwe Hermann <uh@uleenucks.de>
This commit is contained in:
@@ -36,6 +36,7 @@ function check_dir_exist() {
|
||||
# Arguments:
|
||||
# None
|
||||
########################################
|
||||
# shellcheck disable=SC2153
|
||||
function configure_postgresql() {
|
||||
echo "${POSTGRES_HOST}:${POSTGRES_PORT}:${POSTGRES_DB}:${POSTGRES_USER}:${POSTGRES_PASSWORD}" > ~/.pgpass
|
||||
chmod 0600 ~/.pgpass
|
||||
@@ -50,11 +51,12 @@ function configure_postgresql() {
|
||||
# Reference:
|
||||
# https://gist.github.com/judy2k/7656bfe3b322d669ef75364a46327836#gistcomment-3632918
|
||||
########################################
|
||||
# shellcheck source=/dev/null
|
||||
function export_env_file() {
|
||||
if [[ -f "${ENV_FILE}" ]]; then
|
||||
echo "find \"${ENV_FILE}\" file and export variables"
|
||||
set -a
|
||||
source <(cat "${ENV_FILE}" | sed -e '/^#/d;/^\s*$/d' -e 's/\(\w*\)[ \t]*=[ \t]*\(.*\)/DOTENV_\1=\2/')
|
||||
source <(sed -e '/^#/d;/^\s*$/d' -e 's/\(\w*\)[ \t]*=[ \t]*\(.*\)/DOTENV_\1=\2/' "${ENV_FILE}")
|
||||
set +a
|
||||
fi
|
||||
}
|
||||
@@ -125,7 +127,8 @@ function init_env() {
|
||||
|
||||
# TIMEZONE
|
||||
get_env TIMEZONE
|
||||
local TIMEZONE_MATCHED_COUNT=$(ls "/usr/share/zoneinfo/${TIMEZONE}" 2> /dev/null | wc -l)
|
||||
local TIMEZONE_MATCHED_COUNT
|
||||
TIMEZONE_MATCHED_COUNT=$(ls "/usr/share/zoneinfo/${TIMEZONE}" 2> /dev/null | wc -l)
|
||||
if [[ "${TIMEZONE_MATCHED_COUNT}" -ne 1 ]]; then
|
||||
TIMEZONE="UTC"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user