diff --git a/scripts/config b/scripts/config index 5a7a2ac..35e9cd0 100644 --- a/scripts/config +++ b/scripts/config @@ -120,7 +120,7 @@ ynh_app_config_validate() { ynh_app_config_apply() { _ynh_app_config_apply - ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint + ynh_add_fpm_config } ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install index c1b9599..fe87cb8 100755 --- a/scripts/install +++ b/scripts/install @@ -1,33 +1,13 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers source _ynh_mysql_connect_as.sh -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= - maintenance_mode=0 -fpm_footprint="high" -fpm_free_footprint=0 -fpm_usage="medium" phpflags="--define apc.enable_cli=1" -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= - ynh_app_setting_set --app=$app --key=maintenance_mode --value=$maintenance_mode -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 ynh_app_setting_set --app=$app --key=phpflags --value=$phpflags #================================================= @@ -65,8 +45,9 @@ ynh_setup_source --dest_dir="$install_dir" #================================================= ynh_script_progression --message="Configuring PHP-FPM..." --weight=5 -# Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_app_setting_set --app=$app --key=fpm_footprint --value=high +ynh_app_setting_set --app=$app --key=fpm_usage --value=medium +ynh_add_fpm_config #================================================= # NGINX CONFIGURATION diff --git a/scripts/remove b/scripts/remove index d09cafe..c39ac68 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers diff --git a/scripts/restore b/scripts/restore index 90d8fba..fe6be1e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers source ../settings/scripts/_ynh_mysql_connect_as.sh @@ -35,7 +29,7 @@ ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion +ynh_add_fpm_config #================================================= # RESTORE THE NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index fd7a5f6..f84cb99 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,18 +1,8 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - upgrade_type=$(ynh_check_app_version_changed) #================================================= @@ -29,24 +19,6 @@ if [ -z "${maintenance_mode:-}" ]; then 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 - 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 - 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 - fpm_usage=medium - ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -fi - # If phpflags doesn't exist, create it if [ -z "${phpflags:-}" ]; then phpflags="--define apc.enable_cli=1" @@ -64,7 +36,7 @@ fi ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_add_fpm_config #================================================= # NGINX CONFIGURATION