From 6a13ead388d9677313cf9440013b56bc12cf93e3 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Fri, 9 Jun 2017 17:13:14 +0200 Subject: [PATCH] Update mysql settings --- scripts/install | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index 9811621..9dfe523 100755 --- a/scripts/install +++ b/scripts/install @@ -52,15 +52,21 @@ tar -cf source.tar.gz diaspora/ mv source.tar.gz diaspora/public/source.tar.gz sudo cp -ar diaspora $final_path/../. -# DATABASE -db_name=$app -db_user=$app -db_pwd=$(ynh_string_random) -ynh_mysql_create_db "$db_name" "$db_user" "$db_pass" -ynh_app_setting_set "$app" db_name "$db_name" -ynh_app_setting_set "$app" db_pass "$db_pass" -ynh_app_setting_set "$app" db_user "$db_user" -ynh_app_setting_set "$app" mysqlpwd "$db_pass" +### MySQL ### +# If your app use a MySQL database you can use these lines to bootstrap +# a database, an associated user and save the password in app settings. + +# # Generate MySQL password and create database +dbuser=$app +dbname=$app +dbpass=$(ynh_string_random 12) +ynh_app_setting_set "$app" mysqlpwd "$dbpass" +ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass" + +# # Load initial SQL into the new database +ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" \ + < "../sources/sql/mysql.init.sql" +### MySQL end ###