2022-01-10 13:37:52 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
|
|
|
current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC GETTERS FOR TOML SHORT KEY
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
get__fpm_footprint() {
|
|
|
|
# Free footprint value for php-fpm
|
|
|
|
# Check if current_fpm_footprint is an integer
|
|
|
|
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
|
|
|
|
then
|
|
|
|
echo "specific"
|
|
|
|
else
|
|
|
|
echo "$current_fpm_footprint"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
get__free_footprint() {
|
|
|
|
# Free footprint value for php-fpm
|
|
|
|
# Check if current_fpm_footprint is an integer
|
|
|
|
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
|
|
|
|
then
|
|
|
|
# If current_fpm_footprint is an integer, that's a numeric value for the footprint
|
|
|
|
echo "$current_fpm_footprint"
|
|
|
|
else
|
|
|
|
echo "0"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETTERS FOR TOML SHORT KEYS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
set__fpm_footprint() {
|
|
|
|
if [ "$fpm_footprint" != "specific" ]
|
|
|
|
then
|
|
|
|
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
set__free_footprint() {
|
2022-03-22 12:12:19 +01:00
|
|
|
if [ "$fpm_footprint" == "specific" ]
|
2022-01-10 13:37:52 +01:00
|
|
|
then
|
|
|
|
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$free_footprint"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
|
2022-03-22 12:12:19 +01:00
|
|
|
ynh_app_config_validate
|
|
|
|
ynh_app_config_apply
|
2022-01-10 13:37:52 +01:00
|
|
|
|
|
|
|
ynh_app_config_run $1
|