Clean after conflict

This commit is contained in:
Maniack Crudelis 2020-04-13 16:21:45 +02:00 committed by GitHub
parent 40bb0795bd
commit a62513b0b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,6 +77,8 @@ ynh_add_fpm_config () {
if [ -n "$usage" ] || [ -n "$footprint" ]; then
use_template=0
fi
# Do not use a dedicated service by default
dedicated_service=${dedicated_service:-0}
# Set the default PHP-FPM version by default
phpversion="${phpversion:-$YNH_PHP_VERSION}"
@ -98,14 +100,10 @@ ynh_add_fpm_config () {
ynh_add_app_dependencies --package="$package"
fi
# Do not use a dedicated service by default
dedicated_service=${dedicated_service:-0}
if [ $dedicated_service -eq 1 ]
then
local fpm_service="php${phpversion}-fpm-$app"
local fpm_config_dir="/etc/php/$phpversion/dedicated-fpm"
local old_fpm_config_dir="/etc/php/$phpversion/fpm"
else
local fpm_service="php${phpversion}-fpm"
local fpm_config_dir="/etc/php/$phpversion/fpm"
@ -128,6 +126,7 @@ ynh_add_fpm_config () {
# Migrate from mutual php service to dedicated one.
if [ $dedicated_service -eq 1 ]
then
local old_fpm_config_dir="/etc/php/$phpversion/fpm"
# If a config file exist in the common pool, move it.
if [ -e "$old_fpm_config_dir/pool.d/$app.conf" ]
then
@ -163,7 +162,7 @@ ynh_add_fpm_config () {
ynh_get_scalable_phpfpm --usage=$usage --footprint=$footprint
# Copy the default file
cp "$fpm_config_dir/pool.d/www.conf" "$finalphpconf"
cp "/etc/php/$phpversion/fpm/pool.d/www.conf" "$finalphpconf"
# Replace standard variables into the default file
ynh_replace_string --match_string="^\[www\]" --replace_string="[$app]" --target_file="$finalphpconf"