From 5961390b0cb400be04572c9bb98f633cb81319f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 19 Feb 2023 11:59:49 +0100 Subject: [PATCH] fix psql_version not defined --- scripts/install | 5 +++-- scripts/upgrade | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index ace39c9..17396d2 100644 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,8 @@ registration=$YNH_APP_ARG_REGISTRATION app=$YNH_APP_INSTANCE_NAME +psql_version=$PSQL_VERSION + # Allow or deny registration based on is_public if [ $registration -eq 1 ] then @@ -61,6 +63,7 @@ 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=server_name --value=$server_name ynh_app_setting_set --app=$app --key=registration --value=$registration +ynh_app_setting_set --app=$app --key=psql_version --value=$psql_version #================================================= # STANDARD MODIFICATIONS @@ -182,8 +185,6 @@ chown $app:$app "$final_path/dendrite.yaml" #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -psql_version=$PSQL_VERSION - # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/upgrade b/scripts/upgrade index 928a84b..2b3554d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,7 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) registration=$(ynh_app_setting_get --app=$app --key=registration) +psql_version=$PSQL_VERSION #================================================= # CHECK VERSION @@ -73,6 +74,12 @@ if [ -z $server_name ]; then ynh_app_setting_set --app=$app --key=server_name --value=$domain fi +# Define $server_name if not already defined +if [ -z $psql_version ]; then + psql_version=$PSQL_VERSION + ynh_app_setting_set --app=$app --key=psql_version --value=$psql_version +fi + # Load up registration variables if [[ $registration -eq 1 ]] then @@ -194,8 +201,6 @@ chown $app:$app "$final_path/dendrite.yaml" #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 -psql_version=$PSQL_VERSION - # Create a dedicated systemd config ynh_add_systemd_config