#!/bin/bash
MODIFIED=
[ -d /etc/php ] && find /etc/php/ -type f -name "*.conf" -exec grep -il "pm.max_children = 5$" {} \; | xargs sed -i "s/pm.max_children = 5$/pm.max_children = 50/g" 2>/dev/null && MODIFIED=true
[ -d /etc/php5 ] && find /etc/php5/ -type f -name "*.conf" -exec grep -il "pm.max_children = 5$" {} \; | xargs sed -i "s/pm.max_children = 5$/pm.max_children = 50/g" 2>/dev/null && MODIFIED=true
find /opt/plesk/php/ -type f -name "*.conf" -exec grep -il "pm.max_children = 5$" {} \; | xargs sed -i "s/pm.max_children = 5$/pm.max_children = 50/g" 2>/dev/null && MODIFIED=true
if [ ${MODIFIED} ] ; then
/etc/init.d/plesk-php71-fpm restart
/etc/init.d/plesk-php70-fpm restart
/etc/init.d/plesk-php56-fpm restart
fi