aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common/mariadb-init/resources/config/db_init.sh
diff options
context:
space:
mode:
authorguillaume.lambert <guillaume.lambert@orange.com>2021-12-08 11:20:38 +0100
committerKrzysztof Opasiak <k.opasiak@samsung.com>2021-12-15 22:26:41 +0000
commitfb9dc874a2e6419cab4ed231743b3d405c753cb6 (patch)
tree2d53941c142e99f2dea984299c945644d6f5187b /kubernetes/common/mariadb-init/resources/config/db_init.sh
parent0ea903d6d6c9b7e52eb3fd57ba5e3d1f8273b439 (diff)
[COMMON] Fix some array bashisms
pointed out by checkbashisms Issue-ID: OOM-2643 Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com> Change-Id: Iac07813968e42af1f5a18b0cefb4aee85aa2b880
Diffstat (limited to 'kubernetes/common/mariadb-init/resources/config/db_init.sh')
-rwxr-xr-xkubernetes/common/mariadb-init/resources/config/db_init.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/kubernetes/common/mariadb-init/resources/config/db_init.sh b/kubernetes/common/mariadb-init/resources/config/db_init.sh
index df7c336405..8f7e7ce44b 100755
--- a/kubernetes/common/mariadb-init/resources/config/db_init.sh
+++ b/kubernetes/common/mariadb-init/resources/config/db_init.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
{{/*
# Copyright © 2019 Orange
@@ -32,13 +32,13 @@ while read DB ; do
*/}}
eval USER=\$$USER_VAR
PASS=$(eval echo -n \$$PASS_VAR | sed -e "s/'/''/g")
- MYSQL_OPTS=( -h ${DB_HOST} -P ${DB_PORT} -uroot -p${MYSQL_ROOT_PASSWORD} )
+ MYSQL_OPTS=" -h "${DB_HOST}" -P "${DB_PORT}" -uroot -p"${MYSQL_ROOT_PASSWORD}
echo "Creating database ${DB} and user ${USER}..."
- mysql "${MYSQL_OPTS[@]}" -e "CREATE OR REPLACE USER '${USER}'@'%' IDENTIFIED BY '${PASS}'"
- mysql "${MYSQL_OPTS[@]}" -e "CREATE DATABASE IF NOT EXISTS ${DB}"
- mysql "${MYSQL_OPTS[@]}" -e "GRANT ALL PRIVILEGES ON ${DB}.* TO '${USER}'@'%'"
+ mysql $MYSQL_OPTS -e "CREATE OR REPLACE USER '${USER}'@'%' IDENTIFIED BY '${PASS}'"
+ mysql $MYSQL_OPTS -e "CREATE DATABASE IF NOT EXISTS ${DB}"
+ mysql $MYSQL_OPTS -e "GRANT ALL PRIVILEGES ON ${DB}.* TO '${USER}'@'%'"
echo "Created database ${DB} and user ${USER}."
done <<EOF