diff --git a/scripts/upgrade b/scripts/upgrade index 6e129f8..4e0c836 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,9 +15,6 @@ source /usr/share/yunohost/helpers ynh_script_progression --message="Loading installation settings..." --weight=3 user_home=$(ynh_app_setting_get --app=$app --key=user_home) -maintenance_mode=$(ynh_app_setting_get --app=$app --key=maintenance_mode) -fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) -fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) #================================================= # CHECK VERSION @@ -34,35 +31,29 @@ ynh_script_progression --message="Ensuring downward compatibility..." ynh_app_setting_delete --app=$app --key=backup_core_only # If maintenance_mode doesn't exist, create it -if [ -z "$maintenance_mode" ]; then +if [ -z "${maintenance_mode:-}" ]; then maintenance_mode=0 ynh_app_setting_set --app=$app --key=maintenance_mode --value=$maintenance_mode fi # If fpm_footprint doesn't exist, create it -if [ -z "$fpm_footprint" ]; then +if [ -z "${fpm_footprint:-}" ]; then fpm_footprint=high ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint fi # If fpm_free_footprint doesn't exist, create it -if [ -z "$fpm_free_footprint" ]; then +if [ -z "${fpm_free_footprint:-}" ]; then fpm_free_footprint=0 ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint fi # If fpm_usage doesn't exist, create it -if [ -z "$fpm_usage" ]; then +if [ -z "${fpm_usage:-}" ]; then fpm_usage=medium ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi - -# Create a permission if needed -#if ! ynh_permission_exists --permission="api"; then -# ynh_permission_create --permission="api" --label="api" --url="re:$domain\/.well-known\/.*" --allowed="visitors" "all_users" --auth_header="false" --show_tile="false" --protected="true" -#fi - # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini