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:
parent
8c51cab2bf
commit
6a13ead388
1 changed files with 15 additions and 9 deletions
|
@ -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 ###
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue