From 831d2d842a2115aa190c8aea8908743cbb9f9e6e Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Fri, 13 Oct 2017 01:45:29 +0200 Subject: [PATCH] Fix upgrade issues Should be merged quickly Can be really tested, and the upgrade process doesn't work with previous version. --- scripts/upgrade | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 4e433ac..06f6d6b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,22 @@ db_name=$(ynh_app_setting_get $app db_name) with_carddav=$(ynh_app_setting_get $app with_carddav) with_enigma=$(ynh_app_setting_get $app with_enigma) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= + +# If db_name doesn't exist, create it +if [ -z $db_name ]; then + db_name=$(ynh_sanitize_dbid $app) + ynh_app_setting_set $app db_name $db_name +fi + +# If final_path doesn't exist, create it +if [ -z $final_path ]; then + final_path=/var/www/$app + ynh_app_setting_set $app final_path $final_path +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================