1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/diaspora_ynh.git synced 2024-09-03 18:26:13 +02:00

Update mysql settings

This commit is contained in:
Rafi59 2017-06-09 17:13:14 +02:00 committed by GitHub
parent 8c51cab2bf
commit 6a13ead388

View file

@ -52,15 +52,21 @@ tar -cf source.tar.gz diaspora/
mv source.tar.gz diaspora/public/source.tar.gz mv source.tar.gz diaspora/public/source.tar.gz
sudo cp -ar diaspora $final_path/../. sudo cp -ar diaspora $final_path/../.
# DATABASE ### MySQL ###
db_name=$app # If your app use a MySQL database you can use these lines to bootstrap
db_user=$app # a database, an associated user and save the password in app settings.
db_pwd=$(ynh_string_random)
ynh_mysql_create_db "$db_name" "$db_user" "$db_pass" # # Generate MySQL password and create database
ynh_app_setting_set "$app" db_name "$db_name" dbuser=$app
ynh_app_setting_set "$app" db_pass "$db_pass" dbname=$app
ynh_app_setting_set "$app" db_user "$db_user" dbpass=$(ynh_string_random 12)
ynh_app_setting_set "$app" mysqlpwd "$db_pass" 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 ###