From 253eca42d4a3862d7558508803a1cec6f97569f9 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 29 Nov 2026 16:52:19 +0100 Subject: [PATCH] install_postfixadmin.sh: Fix error in restarting PHP engine in case of installed ba debian package system. --- install_postfixadmin.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/install_postfixadmin.sh b/install_postfixadmin.sh index 1bd9d2d..fadbbfb 100755 --- a/install_postfixadmin.sh +++ b/install_postfixadmin.sh @@ -3746,6 +3746,7 @@ if [[ -n "$php_major_versions" ]]; then fi else echo_skipped + warn "Neither an init-script nor a service file for PHP v${_ver} found!" fi done else @@ -3753,17 +3754,26 @@ else echononl " Retart PHP FPM engine v${php_major_version}.." if [[ -f "/etc/init.d/php$(echo $php_major_version | cut -d'.' -f1)-fpm" ]] ; then /etc/init.d/php$(echo $php_major_version | cut -d'.' -f1)-fpm restart > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $log_file)" + fi + elif [[ -f "/usr/lib/systemd/system/php${php_major_version}-fpm.service" ]] ; then + systemctl restart php8.4-fpm.service > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $log_file)" + fi else echo_skipped - fi - if [[ $? -eq 0 ]]; then - echo_ok - else - echo_failed - error "$(cat $log_file)" + warn "Neither an init-script nor a service file for PHP v${php_major_version} found!" fi else - echo_skipped + warn "No PHP installation found!" fi fi