From 14a4272388c8fb37c8a3483c5f1e26e7b9f87928 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 18 Jun 2022 15:31:20 +0200 Subject: [PATCH] Fix password --- scripts/install | 1 + scripts/upgrade | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6c77ac1..04736eb 100644 --- a/scripts/install +++ b/scripts/install @@ -47,6 +47,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=password --value=$password #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index bc253de..503e49f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +password=$(ynh_app_setting_get --app=$app --key=password) #================================================= # CHECK VERSION @@ -73,11 +74,18 @@ fi if [ -z $db_pwd ]; then #c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell - t=$(cat /var/www/$app/conf.php | grep DBPASS) + t=$(cat $final_path/conf.php | grep DBPASS) db_pwd=${t:26:24} ynh_app_setting_set --app=$app --key=mysqlpwd --value=$db_pwd fi +if [ -z $password ]; then +#c'est moche mais ça fera bien l'affaire - en deux lignes sinon pb en fonction du type de shell + t=$(cat $final_path/conf.php | grep ADMIN_PASSWORD) + password=${t:26:24} + ynh_app_setting_set --app=$app --key=password --value=$password +fi + #================================================= # CREATE DEDICATED USER #=================================================