From b993061e34cc4de6b7bdb0dcb3dcc17e90864fce Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 3 Apr 2022 13:57:39 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 196327a..6ec8069 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,6 +24,7 @@ db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) phpversion=$YNH_PHP_VERSION password_hash=$(ynh_app_setting_get --app=$app --key=password_hash) +deskey=$(ynh_app_setting_get --app=$app --key=encrypt_key) #================================================= # CHECK VERSION @@ -129,29 +130,25 @@ ynh_add_fpm_config # UPGRADE BAIKAL #================================================= -# if [ "$upgrade_type" == "UPGRADE_APP" ] -# then -# #================================================= -# # UPGRADE BAIKAL CONFIGURATION -# #================================================= -# ynh_script_progression --message="Upgrading the configuration file..." --weight=2 +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + #================================================= + # UPGRADE BAIKAL CONFIGURATION + #================================================= + ynh_script_progression --message="Upgrading the configuration file..." --weight=2 -# if [ -z "$password_hash" ]; then -# password=$(ynh_app_setting_get --app=$app --key=password) -# password_hash=$(echo -n admin:BaikalDAV:$password | md5sum | cut -d ' ' -f 1) -# ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash -# fi + if [ -z "$password_hash" ]; then + password=$(ynh_app_setting_get --app=$app --key=password) + password_hash=$(echo -n admin:BaikalDAV:$password | md5sum | cut -d ' ' -f 1) + ynh_app_setting_set --app=$app --key=password_hash --value=$password_hash + fi -# bk_conf="${final_path}/config/baikal.yaml" -# timezone=$(cat /etc/timezone) -# path=${path_url%/} -# deskey=$(ynh_app_setting_get --app=$app --key=encrypt_key) -# ynh_app_setting_set --app=$app --key=encrypt_key --value="$deskey" - -# ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" -# chown $app: "$final_path/config/baikal.yaml" -# chmod 640 "$final_path/config/baikal.yaml" -# fi + timezone=$(cat /etc/timezone) + path=${path_url%/} + ynh_add_config --template="../conf/baikal.yaml" --destination="$final_path/config/baikal.yaml" + chown $app: "$final_path/config/baikal.yaml" + chmod 640 "$final_path/config/baikal.yaml" +fi #================================================= # RELOAD NGINX