From fb9dc874a2e6419cab4ed231743b3d405c753cb6 Mon Sep 17 00:00:00 2001 From: "guillaume.lambert" Date: Wed, 8 Dec 2021 11:20:38 +0100 Subject: [COMMON] Fix some array bashisms pointed out by checkbashisms Issue-ID: OOM-2643 Signed-off-by: guillaume.lambert Change-Id: Iac07813968e42af1f5a18b0cefb4aee85aa2b880 --- kubernetes/common/mariadb-init/resources/config/db_init.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'kubernetes/common/mariadb-init/resources') 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 <