From 9d6582460684939c414321c2f608dcef094e6f76 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Thu, 11 Apr 2024 20:41:56 +0200 Subject: [PATCH] v-edit-php tuning --- bin/v-edit-domain-php-ini | 11 ++++++++--- bin/v-edit-php-ini | 10 +++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bin/v-edit-domain-php-ini b/bin/v-edit-domain-php-ini index 83d52613..351f34bc 100644 --- a/bin/v-edit-domain-php-ini +++ b/bin/v-edit-domain-php-ini @@ -69,13 +69,18 @@ else nano "$config_file" fi -echo "Restarting PHP-FPM service for PHP version $fpm_ver..." +echo "Restarting PHP-FPM service for PHP version ${fpm_ver}" systemctl restart php${fpm_ver}-fpm -echo "The PHP-FPM service for PHP version 7.0 has been restarted successfully." +if [ $? -ne 0 ]; then + systemctl status php${fpm_ver}-fpm + check_result $E_RESTART "ERROR: php${fpm_ver}-fpm restart failed - please re-run the command and fix the problem !!!" +else + echo "The PHP-FPM service for PHP version ${fpm_ver} has been restarted successfully." +fi echo "" #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# -exit 1; +exit 0; diff --git a/bin/v-edit-php-ini b/bin/v-edit-php-ini index 4806a48f..696b60ec 100644 --- a/bin/v-edit-php-ini +++ b/bin/v-edit-php-ini @@ -52,11 +52,15 @@ $editor_cmd "$php_ini_path" # Restart the PHP-FPM service for the selected version echo "Restarting the PHP-FPM service for PHP version $php_version..." systemctl restart php${php_version}-fpm - -echo "The PHP-FPM service for PHP version $php_version has been restarted successfully." +if [ $? -ne 0 ]; then + systemctl status php${php_version}-fpm + check_result $E_RESTART "ERROR: php${php_version}-fpm restart failed - please re-run the command and fix the problem !!!" +else + echo "The PHP-FPM service for PHP version ${php_version} has been restarted successfully." +fi #----------------------------------------------------------# # Exit # #----------------------------------------------------------# -exit +exit 0;