tripleo-image-elements/elements/os-svc-install/bin/os-db-create
Gonéri Le Bouder 0a71316726 indent using 4 spaces (3/3)
As advised in I072cf8bf6748d0c910fecffdf2282bcc4656d038, code should
use 4 spaces for indentation.
This commit enforces the use of 4 spaces indentation.
In order to simplify the review process, this patch only cover the
following elements:
 - os-apply-config
 - os-collect-config
 - os-refresh-config
 - os-svc-install
 - pacemaker
 - pypi-mirror
 - qpidd
 - rabbitmq-server
 - snmpd
 - stackuser
 - tripleo-cd

Change-Id: I3f365f6a1cd6fd9e56402ad3bd6572192b85d798
2014-05-23 00:32:41 +02:00

19 lines
393 B
Bash
Executable File

#!/bin/bash
set -eu
function create_db() {
local sql="
create database if not exists $1;
grant all on $1.* to '$2'@'localhost' identified by '$3';
grant all on $1.* to '$2'@'%' identified by '$3';
flush privileges;"
echo "$sql" | mysql
}
if [ $# -lt 3 ]; then
echo "Usage: os-db-create DB_NAME DB_USER DB_PASS"
exit 1
fi
create_db $*