diff --git a/scripts/install b/scripts/install index a11a6d9..ca07780 100644 --- a/scripts/install +++ b/scripts/install @@ -96,10 +96,11 @@ logs_path="/var/log/$app" #================================================= db_name="$app" -db_user="mmuser" +db_user="$YNH_APP_INSTANCE_NAME" db_password=$(ynh_string_random --length=24) ynh_mysql_create_db "$db_name" "$db_user" "$db_password" -ynh_app_setting_set "$app" mysqlpwd "$db_password" +ynh_app_setting_set "$app" mysqluser "$db_user" +ynh_app_setting_set "$app" mysqlpwd "$db_password" #================================================= # CREATE USER FOR EMAIL NOTIFICATIONS diff --git a/scripts/remove b/scripts/remove index 349c576..8f3dfc1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,7 +16,8 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) db_name="$app" -db_user="mmuser" +db_user=$(ynh_app_setting_get $app mysqluser) +db_user=${db_user:-"mmuser"} mattermost_user="$app" final_path="/var/www/$app" data_path="/home/yunohost.app/$app" diff --git a/scripts/restore b/scripts/restore index a4257ce..14f9617 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,7 +26,8 @@ final_path="/var/www/$app" data_path="/home/yunohost.app/$app" logs_path="/var/log/$app" db_name="$app" -db_user="mmuser" +db_user=$(ynh_app_setting_get $app mysqluser) +db_user=${db_user:-"mmuser"} mattermost_user="$app" #=================================================