From 422cb3cc844520dbcaa3ea442f5ebc042b153165 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 17 Sep 2022 15:45:02 +0200 Subject: [PATCH] Add all settings for config panel --- scripts/install | 14 +++++++++++--- scripts/upgrade | 7 +++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index b976518..12f3567 100644 --- a/scripts/install +++ b/scripts/install @@ -108,15 +108,23 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 +fpm_footprint="medium" +fpm_free_footprint=0 + # If the app is private, set the usage to low, otherwise to high. if [ $is_public -eq 0 ] then - usage=low + fpm_usage="low" else - usage=high + fpm_usage="high" fi + +ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint +ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint +ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage + # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$usage --footprint=medium +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 128cb03..a0499ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,7 @@ overwrite_phpfpm=$(ynh_app_setting_get --app=$app --key=overwrite_phpfpm) admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +fpm_free_footprint=$(ynh_app_setting_get --app=$app --key=fpm_free_footprint) fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -131,6 +132,12 @@ if [ -z "$fpm_footprint" ]; then 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 + 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 the app is private, set the usage to low, otherwise to high.