php7.3->7.4: autopatch nginx configs during restore

This commit is contained in:
Alexandre Aubin 2022-08-19 20:45:17 +02:00
parent ec271043cd
commit 18e041c405

View file

@ -285,6 +285,14 @@ ynh_restore_file() {
else
mv "$archive_path" "${dest_path}"
fi
# Boring hack for nginx conf file mapped to php7.3
# Note that there's no need to patch the fpm config because most php apps
# will call "ynh_add_fpm_config" during restore, effectively recreating the file from scratch
if [[ "${dest_path}" == "/etc/nginx/conf.d/"* ]] && grep 'php7.3.*sock' "${dest_path}"
then
sed -i 's/php7.3/php7.4/g' "${dest_path}"
fi
}
# Calculate and store a file checksum into the app settings