File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,14 @@ database_user_password=`date | md5sum | fold -w 12 | head -n 1`
14
14
# # Database user password will be stored in /var/log/check.log ##
15
15
# # Remove /var/log/check.log after retrieving password . ##
16
16
17
- database_availability_check=` mysqlshow --user=root --password= $database_root_password | grep -ow $database_name `
17
+ database_availability_check=none
18
18
19
- if [ " $database_availability_check " == " $database_name " ]; then
20
- exit 1
21
- else
19
+ while [ " $database_availability_check " != " $database_name " ]; do
20
+ database_availability_check= ` mysqlshow --user=root --password= $database_root_password | grep -ow $database_name `
21
+ mysql -u root -p $database_root_password -e " grant all on *.* to 'root'@'%' identified by ' $database_root_password '; "
22
22
mysql -u root -p$database_root_password -e " create database $database_name ;"
23
23
mysql -u root -p$database_root_password -e " grant all on $database_name .* to '$database_user '@'%' identified by '$database_user_password ';"
24
24
echo " Your database user " $database_user " password for database " $database_name " is " $database_user_password " " > /var/log/check.log
25
- fi
25
+ done
26
+
26
27
You can’t perform that action at this time.
0 commit comments