diff options
author | guillaume.lambert <guillaume.lambert@orange.com> | 2021-12-07 15:43:17 +0100 |
---|---|---|
committer | Fiachra Corcoran <fiachra.corcoran@est.tech> | 2022-04-23 10:46:45 +0000 |
commit | b6ee0d3362c582811573198976e51c2ce21961dc (patch) | |
tree | 8a7458598057ebf9a0bb64ae450f7ec8e286feab | |
parent | f757d0bf7b5304bc727e98463943261b4829087b (diff) |
[COMMON] Fix declare bashisms
pointed out by checkbashisms.
Issue-ID: OOM-2643
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I4940176970266238168009ffd56bce956c7ece69
-rw-r--r-- | kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh b/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh index ddaf099bdf..d76e002170 100644 --- a/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh +++ b/kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh @@ -170,11 +170,20 @@ docker_init_database_dir() { mysql_note "Database files initialized" } +if [ -z "$DATADIR" ]; then + DATADIR='unknown' +fi +if [ -z "$SOCKET" ]; then + SOCKET='unknown' +fi +if [ -z "$DATABASE_ALREADY_EXISTS" ]; then + DATABASE_ALREADY_EXISTS='false' +fi + # Loads various settings that are used elsewhere in the script # This should be called after mysql_check_config, but before any other functions docker_setup_env() { # Get config - declare -g DATADIR SOCKET DATADIR="$(mysql_get_config 'datadir' "$@")" SOCKET="$(mysql_get_config 'socket' "$@")" @@ -186,7 +195,6 @@ docker_setup_env() { file_env 'MYSQL_ROOT_PASSWORD' file_env 'PORTAL_DB_TABLES' - declare -g DATABASE_ALREADY_EXISTS if [ -d "$DATADIR/mysql" ]; then DATABASE_ALREADY_EXISTS='true' fi |