From c7d2d8992edb2de1115db6bac3df7a8c83d6f0ce Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 26 Jun 2022 16:13:25 +0200 Subject: [PATCH] Fix variables retrieval --- scripts/upgrade | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0d3fbef..747c1ca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,16 +73,12 @@ if [ -z "$final_path" ]; then 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 $final_path/conf.php | grep DBPASS) - db_pwd=${t:26:24} + db_pwd=$(grep DBPASS $final_path/conf.php | cut -d"'" -f4) 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} + password=$(grep ADMIN_PASSWORD $final_path/conf.php | cut -d"'" -f4) ynh_app_setting_set --app=$app --key=password --value=$password fi