From 18e041c4059af2532f467bb1a63153a4851abad3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 19 Aug 2022 20:45:17 +0200 Subject: [PATCH] php7.3->7.4: autopatch nginx configs during restore --- helpers/backup | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helpers/backup b/helpers/backup index 01b51d5a1..22737ff86 100644 --- a/helpers/backup +++ b/helpers/backup @@ -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