From bed14014e7b0999d04ca73c41e267c92429c279f Mon Sep 17 00:00:00 2001 From: Kay0u Date: Fri, 27 Mar 2020 11:50:56 +0100 Subject: [PATCH] Fix upgrade --- scripts/upgrade | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0ea9ab4..c2bbd7c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,11 +35,6 @@ protected_uris=$(ynh_app_setting_get $app protected_uris) #================================================= ynh_print_info "Ensuring downward compatibility..." -# Delete is_public if it exists -if [ ! -z $is_public ]; then - ynh_app_setting_delete --app=$app --key=is_public -fi - # If db_name doesn't exist, create it if [ -z $db_name ]; then db_name=$(ynh_sanitize_dbid $app) @@ -72,6 +67,14 @@ if [ ! -z $password ]; then ynh_app_setting_delete $app password fi +# Delete is_public if it exists +if [ ! -z $is_public ]; then + if [ "$is_public" = "1" ]; then + ynh_permission_update --permission "main" --add "visitors" + fi + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================