diff --git a/scripts/install b/scripts/install index c86ded8..42ae890 100644 --- a/scripts/install +++ b/scripts/install @@ -9,6 +9,22 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# RETRIEVE ARGUMENTS FROM THE MANIFEST +#================================================= + +fpm_footprint="low" +fpm_free_footprint=0 +fpm_usage="low" + +#================================================= +# STORE SETTINGS FROM MANIFEST +#================================================= + +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 + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -30,7 +46,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint # Create a dedicated nginx config ynh_add_nginx_config diff --git a/scripts/upgrade b/scripts/upgrade index 30903af..b074f63 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,21 +20,22 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If the admin is not defined, We can't upgrade this app -if [ -z "${admin:-}" ]; then - ynh_die --message="You are upgrading Adminer from a version where the admin is not defined. Please reinstall Adminer" -fi - # If fpm_footprint doesn't exist, create it if [ -z "${fpm_footprint:-}" ]; then - fpm_footprint=low - ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint + fpm_footprint=low + 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=low - ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage + fpm_usage=low + ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage fi #=================================================