Merge "[COMMON] Fix ${p//pat/str} bashism"
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Wed, 8 Sep 2021 09:39:08 +0000 (09:39 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 8 Sep 2021 09:39:08 +0000 (09:39 +0000)
1  2 
kubernetes/portal/components/portal-mariadb/resources/config/mariadb/docker-entrypoint.sh

@@@ -106,7 -106,7 +106,7 @@@ docker_temp_server_start() 
        "$@" --skip-networking --socket="${SOCKET}" &
        mysql_note "Waiting for server startup"
        local i
 -      for i in {30..0}; do
 +      for i in $(seq 30 -1 0); do
                # only use the root password if the database has already been initializaed
                # so that it won't try to fill in a password file when it hasn't been set yet
                extraArgs=""
@@@ -278,10 -278,10 +278,10 @@@ docker_setup_db() 
  
                if [ -n "$MYSQL_DATABASE" ]; then
                        mysql_note "Giving user ${MYSQL_USER} access to schema ${MYSQL_DATABASE}"
-                       echo "GRANT ALL ON \`${MYSQL_DATABASE//_/\\_}\`.* TO '$MYSQL_USER'@'%' ;" |docker_process_sql --database=mysql
+                       echo "GRANT ALL ON \`$(echo $MYSQL_DATABASE | sed 's@_@\\_@g')\`.* TO '$MYSQL_USER'@'%' ;" | docker_process_sql --database=mysql
                fi
  
-               echo "FLUSH PRIVILEGES ;" |docker_process_sql --database=mysql
+               echo "FLUSH PRIVILEGES ;" | docker_process_sql --database=mysql
        fi
  }