From d53e9293b7bb559923d6cf9ef56477b39b5a9b72 Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Tue, 7 Jul 2020 21:17:21 +0300 Subject: [PATCH] [fix] stop PHP-FPM before modifications --- tests/all.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/all.sh b/tests/all.sh index b605c83..f8a2de3 100644 --- a/tests/all.sh +++ b/tests/all.sh @@ -111,6 +111,17 @@ setupPool() { setupPools() { PHP_LIST=$(sudo find /etc/php/ -name 'www.conf' -type f) + + #First we need to stop all PHP-FPM + while IFS= read -r pool; do + if [[ -n $pool ]]; then + POOL_DIR=$(dirname "$pool") + PHP_VERSION=$(echo "$POOL_DIR" | grep -oP "(\d\.\d)") + sudo service "php${PHP_VERSION}-fpm" stop + fi + done <<<"$PHP_LIST" + + #Now we reconfigure them and restart while IFS= read -r pool; do if [[ -n $pool ]]; then setupPool "$pool"