From 6b3131b27a1f880cd38dca362cfab0cb6b1c2253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Andr=C3=A9s?= Date: Thu, 27 Dec 2018 15:29:25 +0100 Subject: [PATCH] Allow php-fpm restart when multiple handlers --- bin/v-restart-web-backend | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bin/v-restart-web-backend b/bin/v-restart-web-backend index e1d8ebe94..fd80ac6db 100755 --- a/bin/v-restart-web-backend +++ b/bin/v-restart-web-backend @@ -50,12 +50,15 @@ if [ -z "$WEB_BACKEND" ] || [ "$WEB_BACKEND" = 'remote' ]; then fi # Restart system -php_fpm=$(ls /etc/init.d/php*-fpm* 2>/dev/null |cut -f 4 -d / |head -n 1) -if [ -z "$php_fpm" ]; then - service $WEB_BACKEND restart >/dev/null 2>&1 -else - service $php_fpm restart >/dev/null 2>&1 -fi +php_fpm=$(ls /etc/init.d/php*-fpm* 2>/dev/null |cut -f 4 -d /) +for back in $php_fpm +do + if [ -z "$php_fpm" ]; then + service $WEB_BACKEND restart >/dev/null 2>&1 + else + service $back restart >/dev/null 2>&1 + fi +done if [ $? -ne 0 ]; then send_email_report