1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/noalyss_ynh.git synced 2024-09-03 19:46:20 +02:00

Fixed change_url & upgrade scripts: db_name key in settings becomes useless and is replaced by a db_user key of the same value; I left declaration as such in change_url script even though I renammed it in other scripts which needed it as for retrocompatibility in case it would be used as a global variable by some of the scripts's function which I didn't inspect (maybe that declaration is even unused).

This commit is contained in:
oleole39 2023-01-20 03:36:08 +01:00
parent 3e385afdd0
commit 0ef3db2452
2 changed files with 6 additions and 9 deletions

View file

@ -30,8 +30,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
# Add settings here as needed by your application
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_user=$(ynh_app_setting_get --app=$app --key=db_user)
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
#=================================================

View file

@ -19,9 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
db_user=$db_name
db_user=$(ynh_app_setting_get --app=$app --key=db_user)
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
#=================================================
@ -49,10 +47,10 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If db_name doesn't exist, create it
if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
# If db_user doesn't exist, create it
if [ -z "$db_user" ]; then
db_user=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_user --value=$db_user
fi
# If final_path doesn't exist, create it