From d6fcd29677f75b1b7ac1901d298ddaad500c9e4f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 26 Sep 2021 13:55:19 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 27f5e05..8528370 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,9 +121,10 @@ then ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php" fi chmod 755 $final_path + # Create the visitors permission if needed - if [ $is_public -eq 1 ] - then + visitors_enabled=$(ynh_permission_has_user "main" "visitors") + if [[ $visitors_enabled -eq 0 ]] ynh_permission_update --permission "main" --add "visitors" fi @@ -133,6 +134,11 @@ then sleep 5 ynh_local_curl "/index.php" upgrade_type="UPGRADE_APP" + + if [[ $visitors_enabled -eq 0 ]] + ynh_permission_update --permission "main" --remove "visitors" + fi + fi #=================================================