Allow php-fpm restart when multiple handlers

This commit is contained in:
José Pedro Andrés 2018-12-27 15:29:25 +01:00
commit 6b3131b27a

View file

@ -50,12 +50,15 @@ if [ -z "$WEB_BACKEND" ] || [ "$WEB_BACKEND" = 'remote' ]; then
fi fi
# Restart system # Restart system
php_fpm=$(ls /etc/init.d/php*-fpm* 2>/dev/null |cut -f 4 -d / |head -n 1) php_fpm=$(ls /etc/init.d/php*-fpm* 2>/dev/null |cut -f 4 -d /)
if [ -z "$php_fpm" ]; then for back in $php_fpm
service $WEB_BACKEND restart >/dev/null 2>&1 do
else if [ -z "$php_fpm" ]; then
service $php_fpm restart >/dev/null 2>&1 service $WEB_BACKEND restart >/dev/null 2>&1
fi else
service $back restart >/dev/null 2>&1
fi
done
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
send_email_report send_email_report